{
  "id": "vertex-degree",
  "title": "Degree (Graph Theory)",
  "lang": "en",
  "source_lang": "en",
  "summary": "The degree of a vertex counts its incident edge ends, providing a basic measure of local connectivity and a foundation for many graph-theoretic results.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Vertex degree",
    "Node degree",
    "Valency"
  ],
  "generated_at": "2026-11-06",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/vertex-degree/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/vertex-degree/",
      "json": "https://aiwiki.page/zh/vertex-degree.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "In graph theory, the degree of a vertex is the number of edge ends incident with it. In an undirected graph without loops or parallel edges, this is simply the number of its neighbors. A loop contributes two to the degree of its vertex, while parallel edges are counted separately. Degree describes local connectivity and is fundamental to the study of graph structure, traversal, coloring, and networks."
    },
    {
      "heading": "Definition and conventions",
      "text": "Let \\(G=(V,E)\\) be an undirected graph, with vertex set \\(V\\) and edge set \\(E\\). The degree of a vertex \\(v\\) is usually written\n\n\\[\\deg_G(v),\\qquad \\deg(v),\\qquad\\text{or}\\qquad d(v).\\]\n\nFor a simple graph—a graph with neither loops nor parallel edges—define the neighborhood of \\(v\\) by\n\n\\[N_G(v)=\\{u\\in V:\\{u,v\\}\\in E\\}.\\]\n\nThen\n\n\\[\\deg_G(v)=|N_G(v)|.\\]\n\nThe distinction between incident edges and incident edge ends matters when loops are allowed. A loop has both ends at the same vertex and therefore contributes two to its degree. For example, a vertex incident with two ordinary edges and one loop has degree four.\n\nIn a multigraph, distinct edges may join the same pair of vertices. Each contributes separately to degree, so degree need not equal the number of distinct neighbors. A vertex joined to one other vertex by three parallel edges has degree three but only one distinct neighbor.\n\nCommon terms include:\n\n- Isolated vertex: a vertex of degree zero.\n- Leaf or pendant vertex: a vertex of degree one.\n- Even vertex or odd vertex: a vertex whose degree is even or odd.\n- Universal vertex: in a simple graph with \\(n\\) vertices, a vertex adjacent to every other vertex, hence of degree \\(n-1\\).\n\nUnless otherwise specified, numerical identities involving sums of degrees concern finite graphs."
    },
    {
      "heading": "Minimum, maximum, and average degree",
      "text": "For a finite graph with at least one vertex, the minimum and maximum degrees are\n\n\\[\\delta(G)=\\min_{v\\in V}\\deg(v), \\qquad \\Delta(G)=\\max_{v\\in V}\\deg(v).\\]\n\nThe average degree is\n\n\\[\\overline d(G)=\\frac{1}{|V|}\\sum_{v\\in V}\\deg(v).\\]\n\nThese quantities satisfy\n\n\\[\\delta(G)\\leq \\overline d(G)\\leq \\Delta(G).\\]\n\nA regular graph is one in which all vertices have the same degree. If this common degree is \\(r\\), the graph is called \\(r\\)-regular. A finite simple 2-regular graph is a disjoint union of cycles; a 3-regular graph is also called a cubic graph.\n\nSome standard examples illustrate the distinction between local and global structure:\n\nGraph | Vertex degrees\nComplete graph on \\(n\\) vertices | Every vertex has degree \\(n-1\\)\nPath on \\(n\\geq2\\) vertices | Two vertices have degree 1; all others have degree 2\nCycle on \\(n\\geq3\\) vertices | Every vertex has degree 2\nStar on \\(n\\geq3\\) vertices | One vertex has degree \\(n-1\\); the others have degree 1\nComplete bipartite graph \\(K_{p,q}\\), with \\(p,q\\geq1\\) | Vertices in the part of size \\(p\\) have degree \\(q\\), and conversely"
    },
    {
      "heading": "The handshaking lemma",
      "text": "The handshaking lemma states that, for a finite undirected graph,\n\n\\[\\sum_{v\\in V}\\deg(v)=2|E|.\\]\n\nIts proof is a double count: every edge has two ends and contributes exactly two to the sum, including when both ends belong to the same vertex. This explains why loops are counted twice.\n\nTwo immediate consequences are:\n\n- The number of odd-degree vertices is even.\n- If the graph has \\(n>0\\) vertices and \\(m\\) edges, its average degree is\n\n\\[\\overline d=\\frac{2m}{n}.\\]\n\nFor a finite simple graph with \\(n\\geq2\\), edge density is the fraction of possible edges that are present:\n\n\\[\\rho=\\frac{m}{\\binom n2}.\\]\n\nConsequently,\n\n\\[\\overline d=\\rho(n-1).\\]\n\nDegree and density therefore measure related but different features: degree describes connectivity around vertices, whereas density normalizes the total edge count by graph size."
    },
    {
      "heading": "Directed graphs",
      "text": "In a directed graph, each edge, or arc, has a source and a target. Degree splits into two quantities:\n\n- In-degree, \\(\\deg^-(v)\\): the number of arcs entering \\(v\\).\n- Out-degree, \\(\\deg^+(v)\\): the number of arcs leaving \\(v\\).\n\nA directed loop contributes one to each. If total degree is used, it is normally defined as\n\n\\[\\deg(v)=\\deg^-(v)+\\deg^+(v),\\]\n\nso a directed loop contributes two to total degree.\n\nFor a finite directed graph,\n\n\\[\\sum_{v\\in V}\\deg^-(v) = \\sum_{v\\in V}\\deg^+(v) = |E|.\\]\n\nA vertex with in-degree zero is often called a source, and one with out-degree zero a sink, though some conventions reserve these terms for nonisolated vertices. Every finite, nonempty directed acyclic graph has at least one vertex of in-degree zero and at least one of out-degree zero."
    },
    {
      "heading": "Degree sequences",
      "text": "A degree sequence lists the degrees of all vertices, usually in nonincreasing order:\n\n\\[d_1\\geq d_2\\geq\\cdots\\geq d_n.\\]\n\nA sequence is called graphical if some simple undirected graph has exactly those vertex degrees.\n\nNecessary conditions include\n\n\\[0\\leq d_i\\leq n-1 \\quad\\text{and}\\quad \\sum_{i=1}^{n}d_i\\ \\text{is even}.\\]\n\nThese conditions are not sufficient. For example, \\((3,3,1,1)\\) satisfies both, but cannot be realized: the two degree-three vertices would each have to be adjacent to both degree-one vertices, forcing those vertices to have degree at least two.\n\nThe Erdős–Gallai theorem gives a complete characterization. A nonincreasing sequence of nonnegative integers is graphical if and only if its sum is even and, for every \\(k=1,\\ldots,n\\),\n\n\\[\\sum_{i=1}^{k}d_i \\leq k(k-1)+\\sum_{i=k+1}^{n}\\min(d_i,k).\\]\n\nThe Havel–Hakimi algorithm provides another test. It repeatedly removes the largest entry \\(d\\), subtracts one from the next \\(d\\) largest entries, and reorders the remaining sequence. The original sequence is graphical precisely when this process reaches an all-zero sequence without requiring an impossible subtraction.\n\nA degree sequence generally does not determine a graph up to isomorphism. A cycle on six vertices and two disjoint triangles both have degree sequence \\((2,2,2,2,2,2)\\), although only the former is connected."
    },
    {
      "heading": "Matrix representations",
      "text": "For a simple undirected graph with adjacency matrix \\(A\\),\n\n\\[\\deg(v_i)=\\sum_j A_{ij}.\\]\n\nThus the vector of degrees is\n\n\\[\\mathbf d=A\\mathbf 1,\\]\n\nwhere \\(\\mathbf 1\\) is the all-ones column vector.\n\nThe degree matrix is the diagonal matrix\n\n\\[D=\\operatorname{diag}(d_1,\\ldots,d_n).\\]\n\nThe graph Laplacian is\n\n\\[L=D-A.\\]\n\nIt satisfies \\(L\\mathbf1=\\mathbf0\\) and connects degree to spectral methods, diffusion, and graph partitioning.\n\nFor a directed graph under the convention that \\(A_{ij}\\) counts arcs from \\(v_i\\) to \\(v_j\\), row sums give out-degrees and column sums give in-degrees.\n\nWhen undirected loops are allowed, adjacency-matrix conventions differ: a loop may be represented by one or by two on the diagonal. The row-sum identity for degree requires diagonal entries that count each loop twice."
    },
    {
      "heading": "Structural and algorithmic significance",
      "text": "Degree conditions often constrain global properties, but their implications depend on additional assumptions.\n\nTrees and edge traversal\n\nA finite tree with \\(n\\) vertices has \\(n-1\\) edges, so\n\n\\[\\sum_{v\\in V}\\deg(v)=2n-2.\\]\n\nEvery finite tree with at least two vertices has at least two leaves.\n\nDegree parity also characterizes Eulerian trails, which use every edge exactly once. For a finite undirected graph with at least one edge, suppose all nonisolated vertices lie in one connected component. The graph has:\n\n- an Eulerian circuit if and only if every vertex has even degree;\n- an open Eulerian trail if and only if exactly two vertices have odd degree.\n\nIn the second case, the odd-degree vertices are the endpoints of the trail.\n\nColoring and Hamiltonian cycles\n\nA greedy vertex-coloring algorithm uses at most \\(\\Delta(G)+1\\) colors on a finite simple graph: when a vertex is colored, at most \\(\\Delta(G)\\) colors are excluded by its neighbors.\n\nMinimum degree can force stronger global structure. Dirac’s theorem states that a finite simple graph on \\(n\\geq3\\) vertices has a Hamiltonian cycle if\n\n\\[\\delta(G)\\geq\\frac n2.\\]\n\nThis is a sufficient condition, not a necessary one.\n\nComputational cost\n\nIn an adjacency-list representation, examining all neighbors of \\(v\\) takes time proportional to its degree in a simple graph. Summing these costs over all vertices gives \\(2m\\), which helps explain the \\(O(n+m)\\) running time of standard graph-traversal algorithms, using big-O notation."
    },
    {
      "heading": "Network applications and limitations",
      "text": "In network analysis, degree measures the number of direct connections associated with a node. Normalized degree centrality in a simple graph with \\(n>1\\) vertices is\n\n\\[C_D(v)=\\frac{\\deg(v)}{n-1}.\\]\n\nFor directed networks, in-degree and out-degree are usually treated separately because incoming and outgoing connections may have different meanings.\n\nThe degree distribution records the fraction of vertices having each degree:\n\n\\[P(k)=\\frac{|\\{v\\in V:\\deg(v)=k\\}|}{|V|}.\\]\n\nIf a vertex is selected uniformly at random, its degree is a random variable with this distribution, and its expected value is the average degree.\n\nDegree is local: it does not reveal how a vertex’s neighbors are connected, whether it bridges distant regions, or how far it lies from other vertices. Networks with the same degree sequence can differ in connectivity, clustering, and path lengths.\n\nFor weighted networks, the sum of incident edge weights is often called strength or weighted degree. This must be distinguished from ordinary degree, which counts edge ends rather than connection weights. Likewise, observing a broad degree distribution does not by itself establish a power law."
    },
    {
      "heading": "Infinite graphs",
      "text": "In an infinite graph, a vertex may have finite or infinite degree. A graph is locally finite if every vertex has finite degree, even when the graph has infinitely many vertices.\n\nInfinite degrees can be expressed using cardinal numbers. Finite parity arguments do not extend unchanged: a one-way infinite path has exactly one odd-degree vertex—its initial vertex has degree one, while every other vertex has degree two. Thus the statement that the number of odd-degree vertices is even requires finiteness."
    }
  ],
  "links": [
    "graph-theory",
    "directed-graph",
    "directed-acyclic-graph",
    "isomorphism",
    "adjacency-matrix",
    "matrix",
    "graph-laplacian",
    "tree-graph",
    "eulerian-trail",
    "graph-coloring",
    "big-o-notation",
    "random-variable",
    "expected-value",
    "power-law",
    "cardinality"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}