Professional Documents
Culture Documents
(a) Draw a graph to represent this informa?on, where each vertex represents a
student and an edge connects two ver?ces if the corresponding students study
together.
1
10/15/20
• The posi?on of the ver?ces, the lengths of the edges, and the shape
of the edges do not maBer in a graph. What we look at is the number
of ver?ces and which of them are joined by edges.
a) Which student is involved in the most study groups with the others?
b) Which student has only one study group in common with the others?
c) How many study groups does Laura have in common with the others?
ANS. a) Amber; b) Kayla ; c) 2
Example: Determine whether the graphs are equivalent GRAPHS that model different
applications
• Composi?on of two teams. • A telephone network
• How many lines need to be cut to
Ellen disconnect the system?
Tina
Amy
The two graphs represent the same connec?ons among the ver?ces.
Edges: AC, AE, BD, BE, CE, DE Lucille
Jen Sally
80 176 60
95 241
104
188 B4
Staff Graphic Copy- B5
writer Auditor Programmer
Trainer Designer
2
10/15/20
e1
Formal Notations U V
V(G) = {U, V, W, X, Y}
e3 e2
Y
• A graph G consists of two finite sets V(G) and E(G) and E(G) = { e1, e2, e3, e4 }
W
e4
denote the graph as G = (V(G), E(G)) X
• V(G) is the vertex set of G, which is necessarily a non-empty set
• E(G) is the edge set of G, which could be empty • Edge e2 is incident to vertex X.
• Vertex U and V are adjacent to each other.
e1
U V e1 ! UV or VU • Edges e1 and e2 are adjacent to each other.
V(G) = {U, V, W, X, Y}
e3 e2
e2 ! UX or XU
Y e3 ! UW or WU
E(G) = { e1, e2, e3, e4 }
W
e4
e4 ! WX or XW
X
e1 V
U
e7
• Edges e4 and e5 are mul<ple edges. • The graphs below have edges that form the same connec?on of
e3 e2 e6 ver?ces in each graph. Thus, they are equal because they have the
Y • Edge e7 is a loop. same vertex set and the same set of edges.
e4 • A graph is called simple if it has no loops
W
X and no mul?ple edges.
e5
3
10/15/20
W 9 X
EULER CIRCUITS
• Adjacency matrix
U V W X Y
U 0 15 8 2 0
V 15 0 0 0 9
W 8 0 0 9 0
X 2 0 9 0 0
Y 0 9 0 0 0
TERMINOLOGY DEFINITION
• The degree of a vertex is the number of • An edge of a graph is called a bridge if its removal from the graph will
edges aBached to it. (Loops are counted add to its number of components.
twice.)
Iden<fy the bridges (if any) in the following graphs.
J K L
DEFINITIONS TERMINOLOGY
• An Euler circuit of a graph is a circuit that passes through every edge
• A path in a graph is an alterna?ng exactly once. (The path may cross ver?ces more than once.)
sequence of ver?ces and edges. It can be
seen as a trip from one vertex to another • A graph that has an Euler circuit is called Eulerian.
by traversing edges.
• A closed path is a path where the ini?al and Which of the following graphs is Eulerian (i.e., has an Euler circuit)?
final ver?ces are the same. This is also
called a circuit. Examples:
F – G – H – E
W X
A – B – C – E – B
Can you find a path that contains all the edges exactly once? D – B – E – G – D Z
Can you find a path that contains all the ver<ces exactly once? Non-Example:
D – E – H – D
Y
4
10/15/20
(a) Ver?ces C and D are of odd degree. By the EGT, the graph does not
have an Euler circuit.
(b) All ver?ces are of even degree. By the EGT, the graph has an Euler
Circuit.
5
10/15/20
• Each vertex is of even degree (2,4, or 6). Thus, by EGT, the graph is
Eulerian. By trial and error, we obtain one Euler circuit, as follows:
B-A-F-B-E-F-G-E-D-G-B-D-C-B
W X
Z
6
10/15/20
• Start at a vertex of odd degree (C or D). By trial and error, one such
path is C-B-F-B-A-F-E-D-C-F-D
7
10/15/20
Fleury’s Algorithm
1. Make sure the graph has either 0 or 2 odd ver?ces.
2. If there are 0 odd ver?ces, start anywhere.
If there are 2 odd ver?ces, start at one of them. WEIGHTED GRAPHS
3. Trace edges one at a ?me. Once an edge is traced, “delete” it. If you
have a choice between a bridge and a non-bridge, always choose
the non-bridge.
4. Stop when you run out of edges.
“Don’t burn your bridges.”
An edge of a graph is called a bridge if its removal from the graph will add to its number of components.
Dirac’s Theorem
• THERE IS NO STRAIGHTFORWARD CRITERION TO •
GUARANTEE THAT A GRAPH IS HAMILTONIAN.
NOTE:
This provides only a sufficient condi8on. It’s not a necessary condi8on!
8
10/15/20
Applying Dirac’s theorem Apply Dirac’s theorem to verify that the graph is
The graph shows the available flights of a small airline. An edge Hamiltonian. Then find the Hamiltonian circuit. What does
between two ver?ces in the graph means that the airline has direct the Hamiltonian circuit represent in terms of flights?
flights between the two corresponding ci?es. • n=6
• Every vertex has a degree of at least n/2 = 3. By Dirac’s theorem, the
graph is Hamiltonian.
• By trial and error, one Hamiltonian circuit is
Portland-Boise-BuBe-Salt Lake City-Reno-Sacramento-Portland.
This represents a sequence of flights that visits each city and returns to
the star?ng city without visi?ng any city twice.