From a town to a graph: nodes, edges and degree, why the degrees always add up to twice the edges, and what a new bridge does to the degrees.
Step 1 of 5 · From a town to a graph
Step 1 of 5
From a town to a graph
The town of Königsberg, today Kaliningrad, was built on the river Pregel, which splits round an island. Four pieces of land, A to D, and seven bridges between them. When Leonhard Euler thought about the town in 1736, he saw that the shape of the lands and the length of the bridges change nothing: all that matters is what is joined to what.
A picture like that is called a graph: nodes (the lands) and edges (the bridges) joining pairs of nodes. The degree of a node is the number of edges touching it. Graphs describe nearly every network: social networks, roads, websites and routers. Predict, and then Look inside will shrink the town into a graph.
Step 2 of 5
Degrees
Each node in the graph is labelled with its degree. When you add up all the degrees, each edge is counted once at each of its ends.
Step 3 of 5
Handshakes
A surprising fact follows, the handshake lemma: at a party, the number of people who shook an odd number of hands is always even. The degrees add up to an even number, so the odd nodes come in pairs.
Step 4 of 5
A new bridge
In the Scene you can remove bridges or add two new ones. Each bridge touches two lands, so it changes two degrees.
Step 5 of 5
Counting back
The link between degrees and edges works both ways. In the graph of five bridges, for instance, you can count the bridges, but you can also add up the degrees and halve them.
Loading the interactive version…
Loading the interactive version…
Each step sets up the Scene for you, and a control marked “fixed” stays put for that step.
Practice · Predict, then look
The four lands of Königsberg will be nodes, and the seven bridges edges. The degree of a node is the number of edges touching it. What is the degree of the island A?
Practice · Predict, then look
The four lands of Königsberg will be nodes, and the seven bridges edges. The degree of a node is the number of edges touching it. What is the degree of the island A?
Practice · Calculate
Add up the degrees of all four nodes. What is the total?
Practice · Calculate
Add up the degrees of all four nodes. What is the total?
Practice · Choose
Can there be a graph with exactly one node of odd degree?
Practice · Choose
Can there be a graph with exactly one node of odd degree?
Practice · Reach the target
Change the number of Bridges until the north bank B has degree 4, and press Check.
Practice · Reach the target
Change the number of Bridges until the north bank B has degree 4, and press Check.
Practice · Calculate
A graph of four nodes has degrees , , and . How many edges does it have?
Practice · Calculate
A graph of four nodes has degrees , , and . How many edges does it have?
Lesson complete. Every practice question here is done.