0% found this document useful (0 votes)
25 views55 pages

15 Handshaking

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views55 pages

15 Handshaking

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 55

Handshaking Lemma

Outline

Handshaking Lemma

Total Degree
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

1
1

1
1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

1
1

1
1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

1
2
1

1
1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

1
2
1

1
1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

1
3
1
1

1
1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

1
3
1
1

1
1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

2
4
1
1

1
1
Revisiting a Puzzle
Puzzle
Is it possible to connect some pairs of
nine points by segments so that each
point is connected to five other points?

2
4 the number of odd points
1 is always even, hence we
1 will never reach a situation
when there are 9 points
1 of degree 5
1
Handshaking

• Before a business meeting, some people


shook hands. Then the number of
people who made an odd number of
handshakes is even
Handshaking

• Before a business meeting, some people


shook hands. Then the number of
people who made an odd number of
handshakes is even
• In graph terms: A graph has an
even number of odd nodes
Degree Sum
Formula
Lemma
For any graph G(V, E), the sum of degrees
of all its nodes is twice the number of
edges:


degree(v) = 2 · |E| .
v∈V
Degree Sum
Formula
Lemma
For any graph G(V, E), the sum of degrees
of all its nodes is twice the number of
edges:


degree(v) = 2 · |E| .
v∈V

Implies the handshaking lemma: if a graph


had an odd number of odd nodes, then the
sum of degrees would be also odd.
Example
Example
3 5

2 3

1 2
Example
3 5

2 3

1 2

3+5+3+2+1+2=2
·8
Proof
3 5

2 3

1 2
Proof
3 5

2 3

1 2

remove all edges


Proof
0 0

0 0

0 0

remove all edges


Proof
0 0

0 0

0 0

now, start adding them back, one by


one
Proof
0
1 0

0 0
1

0 0

now, start adding them back, one by


one
Proof
0
1 0
1

0
1 0
1

0 0

now, start adding them back, one by


one
Proof
0
1 0
1
2

0
1 0
1
2

0 0

now, start adding them back, one by


one
Proof
0
1 0
1
3
2

0
1 0
1
2

0 0
1

now, start adding them back, one by


one
Proof
0
1 0
1
3
2

0
1
2 0
1
3
2

0 0
1

now, start adding them back, one by


one
Proof
0
1 0
1
3
4
2

0
1
2 0
1
3
2

0
1 0
1

now, start adding them back, one by


one
Proof
0
1
2 5
0
1
3
4
2

0
1
2 0
1
3
2

0
1 0
1

now, start adding them back, one by


one
Proof
0
1
3
2 5
0
1
3
4
2

0
1
2 0
1
3
2

0
1 0
1
2

now, start adding them back, one by


one
Proof
0
1
3
2 5
0
1
3
4
2

0
1
2 0
1
3
2

0
1 0
1
2

each edge contributes 2 to the sum of


degrees
Proof
0
1
3
2 5
0
1
3
4
2

0
1
2 0
1
3
2

0
1 0
1
2

as well as t o twice the number of


edges!
Summary

• Essentially, we proved the formula


by induction on the number of
edges
Summary

• Essentially, we proved the formula


by induction on the number of
edges
• Base case: the formula holds if there
are no edges (all degrees are equal to
0)
Summary

• Essentially, we proved the formula


by induction on the number of
edges
• Base case: the formula holds if there
are no edges (all degrees are equal to
0)
• Induction step: when we add an edge,
the sum of degrees increases by 2
Outline

Handshaking Lemma

Total Degree
Exa
Problem m
At an exam, each of 20 students
solved 3 problems. Each problem was
solved by 5 students. What was the
number of problems?

https://commons.wikimedia.org/wiki/File%3AATC_Admission_Exam.JPG
Solution

• Assume that each student wrote


a solution on a separate piece of
paper
Solution

• Assume that each student wrote


a solution on a separate piece of
paper
• Then, there are 20 × 3 = 60 pieces
of paper
Solution

• Assume that each student wrote


a solution on a separate piece of paper
• Then, there are 20 × 3 = 60 pieces
of paper
• For each problem, let’s stack together
all its five solutions
Solution

• Assume that each student wrote


a solution on a separate piece of paper
• Then, there are 20 × 3 = 60 pieces
of paper
• For each problem, let’s stack together
all its five solutions
• Thus, the number of problems is 60/5 =
12
In Graph
Terms

20 students
In Graph
Terms

20 students k problems
In Graph
Terms

20 students k problems
In Graph
Terms

20 students k problems
In Graph
Terms

20 students k problems
In Graph
Terms

20 students k problems

20 × 3 = |E| = 5 ×
k
In Graph
Terms

20 students k problems

k = 12
Summary

• This is a bipartite graph: each edge


joins a student and a problem
Summary

• This is a bipartite graph: each edge


joins a student and a problem
• We used the double counting technique
to solve the problem:
Summary

• This is a bipartite graph: each edge


joins a student and a problem
• We used the double counting technique
to solve the problem:
• on one hand, the number of edges is equal
to the total degree of the left part (i.e., the
sum of all degree of the nodes from the left
Summary

• This is a bipartite graph: each edge


joins a student and a problem
• We used the double counting technique
to solve the problem:
• on one hand, the number of edges is equal
to the total degree of the left part (i.e., the
sum of all degree of the nodes from the left
• on the other hand, it is equal to the
total degree of the right part

You might also like