Discrete MathematicsGraphs, Paths and Circuits1 of 6
Graphs, Paths and Circuits · 1
Graphs, Degree and the Handshake Lemma
When we want to study how things are connected, like people shaking hands at a party or computers wired together in a network, we strip away everything except the objects themselves and the connections between them.
Can five people at a party each shake hands with exactly three of the others?
Graphs, Vertices and Edges
Moving the vertices or pulling edges across one another changes how the drawing looks, while every vertex keeps the exact same connections.
No matter where the vertices sit or how the edges cross, every vertex keeps the same connections, so the graph stays the same.
***
1
Degree and the Handshake Lemma
The degree of a vertex is the number of edges touching it, and the Handshake Lemma connects the degrees of the individual vertices to the total number of edges in the graph.
Degree and the Handshake Lemma
Counting the line-ends at each vertex and counting the two ends of every edge must give the same total:
line-ends counted by verticesv∈V∑deg(v)=line-ends counted by edges2∣E∣
Here V is the set of vertices, deg(v) is the degree of vertex v, and ∣E∣ is the number of edges (the vertical bars mean "the number of items in the set").
Because every edge has two ends, each edge adds 2 to the sum of all degrees.
Every edge has two ends, so each edge adds one to two degrees and two to the sum of all degrees.
***
2
Counting Edges and Odd-Degree Vertices
We can use line-end counting to find the total number of edges without drawing the graph, and to see right away when a handshake puzzle is impossible.
If 10 servers are each wired directly to 4 other servers, how many ethernet cables connect them? And why did our opening puzzle of 5 people each shaking 3 hands fail?
Counting Edges and Odd-Degree Vertices
10 servers,
each wired to 4 others
cables=?
Text solution
1. Count the cable-ends at the serversEach of the 10 servers has 4 cable-ends plugged into it, which gives the total number of cable-ends in the network:
total cable-ends=10×4=40
2. Pair the cable-ends into whole cablesEvery cable uses 2 ends, so dividing the total ends by 2 gives the number of cables:
∣E∣=240=20 cables
3. Test the five-person handshake puzzle in the same wayFive people each shaking 3 hands would require an odd number of line-ends, which cannot be paired into whole edges:
total line-ends⟹∣E∣=5×3=15=215=7.5 edges(impossible)
Because 2∣E∣ is always even, the sum of all degrees in a graph must be even. Vertices with an even degree do not change whether the sum is even or odd, so the vertices with an odd degree must always pair up to make an even sum.
***
3
The Line-End Budget and Degree Bounds
When we know the number of edges first, we can treat 2∣E∣ as a fixed budget of line-ends to find a missing degree, count how many vertices are in the graph, or find the largest possible size of a graph when we only have a minimum or maximum degree.
Suppose a graph has 12 edges:
If it has 7 vertices and six of them have degrees 5,4,4,3,3, and 3, what is the degree of the seventh vertex?
If instead 3 of its vertices have degree 4 and every other vertex has degree 3, how many vertices are in the graph?
And what if we only know an inequality, such as 21 cables where every server connects to at least 4 others, or 10 vertices where every vertex has degree at most 3?
The Line-End Budget and Degree Bounds
Text solution
1. Find the total line-end budget from the edgesEach of the 12 edges supplies 2 line-ends to hand out to the vertices:
line-end budget=12×2=24
2. Subtract the known degrees to find a missing degreeThe first six vertices use up 22 of the 24 line-ends, leaving the rest for the seventh vertex:
deg(v7)=24−(5+4+4+3+3+3)=24−22=2
3. Group the remaining budget to count unknown verticesIf 3 vertices of degree 4 take 3×4=12 line-ends, the remaining 12 line-ends split into groups of 3 for the degree-3 vertices:
4. Bound the number of vertices using a minimum degreeWith 21 cables supplying 21×2=42 cable-ends, n servers of degree at least 4 need at least 4n ends, which cannot exceed the 42-end budget:
⟹⟹4n≤42n≤10.5at most 10 servers
5. Bound the number of edges using a maximum degreeWith 10 vertices of degree at most 3, the graph has at most 10×3=30 line-ends, which pairs into at most half that many edges:
⟹2∣E∣≤30∣E∣≤15 edges
***
4
Why the Handshake Lemma Is a One-Way Check
If a list of degrees adds up to an even number, does that guarantee we can actually draw the graph?
Let's test two degree lists for 4 vertices that both add up to 8: first 4,2,1,1, and then 3,3,1,1.
1. Check whether any single degree exceeds the number of other verticesIn a 4-vertex graph with no loops or duplicate edges, each vertex has only 3 other vertices to connect to, so the list 4,2,1,1 fails right away:
maximum possible degreeon 4 vertices=4−1=3<4
2. Connect the highest-degree vertices first on 3,3,1,1Each of the two degree-3 vertices must connect to all 3 of the other vertices in the graph, which forces at least 2 edges onto every vertex and makes the degree-1 vertices impossible:
edges forced onto eachof the last two vertices=2=1
Two four-vertex degree lists can have the exact same even sum of 8, while 3,2,2,1 connects cleanly into a graph and 3,3,1,1 forces too many connections onto the degree-1 vertices.
Even when the degrees add up to an even number, some degree lists still can't be wired up without breaking a rule.
***
Key concepts
Every problem here comes down to counting line-ends in two ways:
v∈V∑deg(v)=2∣E∣
Degrees to edges
When you know the degrees, add them to count the line-ends, then divide by 2 to get the edges (for 10 servers of degree 4, there are 10×4=40 ends, so 40÷2=20 cables).
Edges to degrees (the line-end budget)
When you know the edges, multiply by 2 first to find the total budget of line-ends, then hand those ends out to find a missing degree, count unknown vertices, or set up an inequality (with 21 cables giving 42 ends, n servers of degree at least 4 must satisfy 4n≤42, so n≤10).
Odd-degree parity check
Because 2∣E∣ is even, odd-degree vertices must always come in pairs (five vertices of degree 3 require 5×3=15 ends, so no such graph exists).
When not to stop at the Handshake Lemma
When asked if a specific list of degrees on n vertices can be drawn, an even sum is only the first check. Before saying yes, make sure no vertex has degree greater than n−1 (ruling out 4,2,1,1 on 4 vertices) and trace where the edges from the highest-degree vertices must go to see if they force too many edges onto the lowest-degree vertices (ruling out 3,3,1,1 on 4 vertices).
***
5
Practice
1
A computer network has 12 routers, and every router is wired directly to 5 other routers. How many cables are in the network?
Be careful not to stop at 60: that counts each cable twice, once at each router it touches.
How many cable-ends are plugged into the 12 routers altogether, and how many ends does each cable use?
The 12 routers have 12×5=60 cable-ends in total. Be careful not to stop at 60: that counts each cable twice, once at each router it touches. Dividing by 2 ends per cable gives 60÷2=30.
2
A graph has 9 vertices. Six of the vertices have degrees 1,2,3,4,5, and 6. Can the remaining three vertices all have even degrees? Explain why or why not.
Watch out for the slip of thinking that having 3 remaining vertices balances the 3 odd degrees, since what matters is whether the degrees themselves are odd or even.
Count how many of the first six vertices have an odd degree, and check what happens to that count if the last three are all even.
Among the first six vertices, three have odd degrees (1,3, and 5). Watch out for the slip of thinking that having 3 remaining vertices balances the 3 odd degrees, since what matters is whether the degrees themselves are odd or even. If the last three vertices all had even degrees, the entire graph would have 3 odd-degree vertices, which is impossible because the number of odd-degree vertices in any graph must be even. Therefore, the answer is No.
3
A graph with 7 vertices has 14 edges. Five of its vertices have degrees 6,5,4,4, and 3, and the last two vertices have the same degree. What is the degree of each of the last two vertices?
Don't stop at 6, which is the combined degree of the last two vertices together.
Find the total budget of line-ends from the 14 edges before subtracting the degrees of the first five vertices.
The 14 edges supply a budget of 14×2=28 line-ends, and the first five vertices use 6+5+4+4+3=22 line-ends, leaving 28−22=6 line-ends. Don't stop at 6, which is the combined degree of the last two vertices together; splitting those 6 ends equally between the two vertices gives 6÷2=3.
4
A graph has 18 edges. Four of its vertices have degree 5, and every other vertex has degree 4. How many vertices are in the graph in total?
Be careful not to stop at 4, since that only counts the degree-4 vertices and forgets the original 4 vertices of degree 5.
After the four degree-5 vertices take their share of the line-end budget, how many degree-4 vertices can the remaining ends support?
The 18 edges provide a budget of 18×2=36 line-ends. The four degree-5 vertices use 4×5=20 ends, leaving 36−20=16 ends, which gives 16÷4=4 vertices of degree 4. Be careful not to stop at 4, since that only counts the degree-4 vertices and forgets the original 4 vertices of degree 5. Adding both groups gives 4+4=8.
5
A network has 19 cables, and every server must be connected to at least 3 other servers. What is the maximum number of servers the network can have?
Watch out for rounding 12.67 to the nearest whole number (13): 13 servers would require at least 13×3=39 cable-ends, which exceeds our budget of 38.
Compare the total cable-ends supplied by the 19 cables with the minimum number of ends needed by n servers.
The 19 cables supply 19×2=38 cable-ends. With n servers each needing at least 3 ends, 3n≤38, so n≤12.67. Watch out for rounding 12.67 to the nearest whole number (13): 13 servers would require at least 13×3=39 cable-ends, which exceeds our budget of 38. Rounding down gives a maximum of 12.
6
A graph has 7 vertices, and every vertex has degree at most 3. What is the maximum number of edges the graph can have?
Don't round 10.5 up to 11, because 11 edges would require 22 line-ends (the 21st line-end cannot be used on its own since the sum of degrees must be even).
Find the maximum number of line-ends the 7 vertices can hold in total, then convert line-ends into whole edges.
The 7 vertices can hold at most 7×3=21 line-ends, so the number of edges is at most 21÷2=10.5. Don't round 10.5 up to 11, because 11 edges would require 22 line-ends (the 21st line-end cannot be used on its own since the sum of degrees must be even). The maximum number of edges is 10.
7
Can you draw a graph with 5 vertices whose degrees are 4,4,3,2, and 1? Explain why or why not.
Adding the degrees gives 4+4+3+2+1=14, which is even, and no degree exceeds 4. Be careful not to stop here and answer "Yes" just because the list passes the Handshake Lemma.
Instead of stopping at the sum of the degrees, trace where the edges from the two degree-4 vertices must go.
Adding the degrees gives 4+4+3+2+1=14, which is even, and no degree exceeds 4. Be careful not to stop here and answer "Yes" just because the list passes the Handshake Lemma. In a 5-vertex graph, each of the two degree-4 vertices must connect to all 4 of the other vertices. That forces every vertex in the graph to have at least 2 connections, so no vertex can have degree 1. Therefore, the answer is No.