Graph Theory37 sections · 1633 units
Open in Course

Graph Degrees

Node Popularity

Now that you can store the graph, you'll look at a property of nodes. The Degree of a node is the number of edges connected to it.

If node 33 has edges to nodes 11, 55, and 77, its degree is 33. In an undirected graph, summing all degrees gives 2E2E (each edge contributes to two nodes). This identity helps verify your input parsing. High-degree nodes often appear in graph problems. The "center" of a star graph has maximum degree. Tracking degrees helps solve problems like finding hubs or detecting anomalies.