You are on page 1of 14

Chapter 6: Graphs

6.1 Euler Circuits


The Königsberg Bridge Problem
Can you cross each bridge once and only once, and return to
your starting point?
Graphs: Dots and Connections
• Dots are called vertices (one dot is one vertex)
• Connections are called edges
• Graphs are good ways to model connections between things,
for example:
– Bridges between land masses
– Connections between computers on a network
– People who know each other
– Flights between cities
The Bridge Map as a Graph
Now the question is: Can you traverse each edge once and only
once, and get back to your starting vertex?

(Such a path in a graph is called an Euler Circuit; some graphs


have them and some don’t.)
What We Just Found
In order for a graph to have an Euler Circuit, it must:
• Be connected, and
• Every vertex in the graph must have an even number of edges
“sprouting” from it.
(Note: the number of “sprouts” from a vertex is called the degree of the
vertex, so every vertex must have even degree)
Euler Circuit Theorem
A graph that has an Euler Circuit must be connected
and every vertex must have even degree.
Furthermore, any graph will those two properties will
always have an Euler Circuit.

(To find an Euler Circuit in such a graph, you can start at any vertex and just keep
following edges until you get back to your starting point, and then add in any
loop-de-loops you need to use up all the edges.)
More Examples
More Examples
More Examples
Euler Paths
Sometimes you can’t get back to where you started, but you can
cross each edge once and only once. This is called an Euler Path.

Example:
Euler Paths
So, when does a graph have an Euler Path?
Euler Paths
So, when does a graph have an Euler Path?

Think about the starting and ending points – what degree should
those vertices have?
Euler Paths
So, when does a graph have an Euler Path?

Think about the starting and ending points – what degree should
those vertices have?

What about the rest of the vertices – what degree should those
vertices have?
Euler Path Theorem
A graph has an Euler Path (but not an Euler Circuit) if and only if
exactly two of its vertices have odd degree and the rest have
even degree.

(The odd vertices will be the starting and ending vertices of the
Euler Path.)

You might also like