m1 l1 Warmup

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

Warm-up

Alexander Golovnev
Outline

Airlines Graph

Knight Transposition

Seven Bridges of Königsberg


Airlines Graph
Consider a small
country with five
cities: A, B, C, D, E.

There are six


flights:
A − B, A − C, A − E,
B − D, C − D, C − E.
Is there a direct
flight from A to D?
With one stop?
With two stops?
Airlines Graph
Consider a small
country with five
cities: A, B, C, D, E. B
There are six
C
flights:
A − B, A − C, A − E, A
B − D, C − D, C − E.
D
Is there a direct
flight from A to D? E
With one stop?
With two stops?
Airlines Graph
Consider a small
country with five
cities: A, B, C, D, E. B
There are six
C
flights:
A − B, A − C, A − E, A
B − D, C − D, C − E.
D
Is there a direct
flight from A to D? E
With one stop?
With two stops?
Airlines Graph
Consider a small
country with five
cities: A, B, C, D, E. B
There are six
C
flights:
A − B, A − C, A − E, A
B − D, C − D, C − E.
D
Is there a direct
flight from A to D? E
With one stop?
With two stops?
Outline

Airlines Graph

Knight Transposition

Seven Bridges of Königsberg


Guarini's Puzzle

Exchange the places of the white knights and


the black knights.
Chess Knight

A chess knight can move in


an L shape in any direction
Chess Knight

A chess knight can move in


an L shape in any direction
Guarini's Puzzle. Solution

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

1 2 3
4 5
6 7 8

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

1 2 3
4 5
6 7 8

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Guarini's Puzzle. Solution

6
1 2 3 2 5

4 5 8 1
6 7 8 4 7
3

Exchange the places of the white knights and


the black knights.
Outline

Airlines Graph

Knight Transposition

Seven Bridges of Königsberg


Seven Bridges of Königsberg

Königsberg, Prussia, 1735


Seven Bridges of Königsberg

Königsberg, Prussia, 1735

Walk through Königsberg

Cross each bridge


exactly once
Seven Bridges of Königsberg

Königsberg, Prussia, 1735

Walk through Königsberg

Cross each bridge


exactly once

Leonhard Euler
Seven Bridges of Königsberg

Königsberg, Prussia, 1735

Walk through Königsberg

Cross each bridge


exactly once

Impossible!

Leonhard Euler
Bridges of Königsberg. Graph
Bridges of Königsberg. Graph
Bridges of Königsberg. Graph
Bridges of Königsberg. Graph

B
Bridges of Königsberg. Graph

B C

D
Bridges of Königsberg. Graph

A
A

B C B C

D
D
Bridges of Königsberg. Graph

A
A

B C B C

D
D
Bridges of Königsberg. Graph

A
A

B C B C

D
D
Bridges of Königsberg. Graph

A
Is there a path which
visits every edge ex-
B C
actly once?
Eulerian Path
D
Eulerian Path

START FINISH
Eulerian Path

START FINISH
Eulerian Path

START FINISH
Eulerian Path

START FINISH
Eulerian Path

START FINISH

All but START and FINISH vertices


have even number of neighbors
Eulerian Path

B C

All but START and FINISH vertices


have even number of neighbors
Eulerian Path

A All four vertices have


odd number of neighbors
B C

All but START and FINISH vertices


have even number of neighbors
Eulerian Path

A All four vertices have


odd number of neighbors
B C Impossible!

All but START and FINISH vertices


have even number of neighbors
Six Bridges of Kaliningrad
Six Bridges of Kaliningrad

B C

D
Six Bridges of Kaliningrad

B and D have odd A


number of neighbors

If there exists an Eule-


B C
rian path, B and D must
be START and FINISH

D
Six Bridges of Kaliningrad

B and D have odd A


number of neighbors

If there exists an Eule-


B C
rian path, B and D must
be START and FINISH

D
Six Bridges of Kaliningrad

B and D have odd A


number of neighbors

If there exists an Eule-


B C
rian path, B and D must
be START and FINISH

D
Six Bridges of Kaliningrad

B and D have odd A


number of neighbors

If there exists an Eule-


B C
rian path, B and D must
be START and FINISH

D
Six Bridges of Kaliningrad

B and D have odd A


number of neighbors

If there exists an Eule-


B C
rian path, B and D must
be START and FINISH

D
Six Bridges of Kaliningrad

B and D have odd A


number of neighbors

If there exists an Eule-


B C
rian path, B and D must
be START and FINISH

D
Six Bridges of Kaliningrad

B and D have odd A


number of neighbors

If there exists an Eule-


B C
rian path, B and D must
be START and FINISH

You might also like