Vertex Degree Calculator

Measure vertex connections with clear graph insights. Handle loops, directions, matrices, and edge lists confidently. Get fast results, exports, examples, and practical guidance today.

Enter graph information

Use comma, semicolon, or line breaks. Matrix mode needs labels that match the matrix order.
Use one edge per line. Add a loop as C-C or C>C. Weights are optional and contribute to weighted degree.
Enter rows on separate lines. Use spaces or commas. Diagonal values represent loop counts.

Example data table

Graph type Vertex labels Input data Selected vertex Expected result
Undirected A, B, C, D A-B, A-C, B-C, C-D, C-C C Degree = 5, loops = 1, neighbors = A, B, C, D
Directed A, B, C, D A>C, B>C, C>D, C>C C In-degree = 3, out-degree = 2, total degree = 5
Undirected matrix A, B, C 0 1 1 / 1 0 1 / 1 1 1 C Degree = 4, loops = 1, average degree = 2.67

Formula used

Undirected degree: deg(v) = incident edges + 2 × self-loops. A loop touches the same vertex twice, so it adds two.

Directed degree: total degree(v) = in-degree(v) + out-degree(v). A directed loop adds one to in-degree and one to out-degree.

Matrix method: for undirected graphs, sum the selected row and add diagonal values once more. For directed graphs, row sum gives out-degree and column sum gives in-degree.

Degree centrality: for undirected graphs, centrality = degree ÷ (n - 1). For directed graphs here, centrality = total degree ÷ 2(n - 1).

Handshake checks: in undirected graphs, the sum of all vertex degrees equals 2E. In directed graphs, total in-degree equals total out-degree and both equal E.

How to use this calculator

  1. Choose edge list or adjacency matrix mode.
  2. Select whether the graph is directed or undirected.
  3. Enter the vertex labels in the exact order you want analyzed.
  4. Type the edge list or paste the matrix values.
  5. Enter the specific vertex label you want evaluated.
  6. Set decimal precision if your matrix includes fractional values.
  7. Press the calculate button to show the result above the form.
  8. Use the export buttons to save the current result as CSV or PDF.

FAQs

1. What does vertex degree mean?

Vertex degree is the number of edge connections touching a chosen vertex. In undirected graphs, every incident edge counts once, while a loop counts twice.

2. How are loops counted?

An undirected loop contributes two to degree because it meets the same vertex at both ends. In directed graphs, one loop adds one incoming and one outgoing connection.

3. What is the difference between degree, in-degree, and out-degree?

Degree is the full connection count for a vertex. In directed graphs, in-degree counts incoming arcs and out-degree counts outgoing arcs. Their sum gives total degree.

4. Can I use an adjacency matrix instead of edges?

Yes. Enter one matrix row per line and provide matching vertex labels. The calculator reads row and column values to compute degree measures for the selected vertex.

5. Do edge weights change the ordinary degree?

Ordinary degree counts connections, not numeric strength. This tool also reports weighted degree, which uses the supplied edge weights so you can compare both measures quickly.

6. Why is the degree sum important?

The total degree sum validates your graph data. In undirected graphs it should equal twice the edge count. In directed graphs, total in-degree and out-degree should match edges.

7. Can this handle multigraph-style counts in matrices?

Yes. Matrix values are treated as connection counts or magnitudes. Larger numeric entries increase the selected vertex totals, which is useful for repeated links or weighted models.

8. What causes a selected vertex error?

That message appears when the chosen vertex label does not exist in your edge list, matrix labels, or typed label set. Matching names exactly fixes it.

Related Calculators

topological sort calculatorminimum spanning tree calculatorgraph distance calculatorford fulkerson calculatorconnected components counterfloyd warshall calculatoreulerian path calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.