GRAPH THEORY: The Mathema2cs of Rela2onships
Learning Outcomes
1. Demonstrate understanding of the key concepts of graph theory
2. Use a graph to model a system of interconnected nodes
3. Recognize applications of graph theory in everyday life.
Königsberg Problem
In the early eighteenth century, a river in a city called Kö nigsberg which was located in modern-day
Russia had seven bridges crossed the river connecting four different areas, similar to the map drawn
below. People at the time would attempt to take a stroll that would lead them across each bridge and
return them to the starting point without passing the same bridge twice.
This is the diagram of Konigsberg
THE QUESTION: Is it possible to take a walk through town, crossing each of the seven bridges just once,
and ending up wherever you started?"
Let us find out! Why or why not?
• Many problems can be modeled as graphs (circuit diagrams, molecules in chemistry) or
weighted graphs, called networks (distance networks, cost networks, decision trees)
• Graph theory is also widely used in sociology as a way, for example, to measure an
individual’s prestige or through the use of social network analysis software.
GRAPH THEORY. is the study of graphs, which are mathematical structures used to model pairwise
relations of objects
A graph is a set of points called vertices and line segments or curves called edges that connect vertices.
A graph G=(V,E) consists of a V, a nonempty set of vertices, and E, a set of edges. Each edge has one or
two vertices associated with it, called its endpoints. An edge is said to connect its endpoints.
The graph represents the flights available on a particular
airline between a selection of cities; each vertex represents
a city, and an edge connecting two cities means that there
is a direct flight between the two cities.
The following table lists five students at a college. An “X” indicates that the two students participate in the
same study group this semester.
a) Draw a graph representing this information where each vertex represents a student and an edge
connects two vertices if the corresponding student studies together.
b) Use your graph to answer the following questions: Which student is involved in the most study
groups with the others? Which student has only one study group in common with the others?
Amber is involved in most study groups. Why?
Kayla has only one study group. Why?
Terminologies and Concepts
G=(V,E)
V={ A,B,C,D,E,F}
E={AB, BC, CD, DE, EF, AF, BE, BE}
There are 5 vertices and 8 edges.
A vertex or a node is a dot on the graph where edges meet. An edge connects
pairs of vertices
BE , BE are multiple edges
A loop is a special edge connecting a vertex to itself. The
degree of a loop is 2.
The degree or valence
of a vertex is the
number of edges
meeting at that vertex
The number of vertices, the cardinality of V, is
called the ORDER of graph .
The number of edges, the cardinality of E, is
called the SIZE of graph . We usually use m to
denote the size of G.
Size of the graph = 8
Order of the graph = 7
Connected Graphs
Connected graphs are graphs in which any vertex can be
reached from any other vertex by tracing along edges.
This is a connected graph in which every possible edge is drawn
between vertices (without any multiple edges). Such a graph is
called a complete graph.
This graph has Mive vertices but no edges and is referred to as a
null graph. It is also an example of a disconnected graph.
Graphs are equivalent graphs if the edges form the same connections of vertices.
The following are equivalent graphs.
Handshaking Lemma
(First Theorem of Graph Theory)
In any graph, the sum of all the vertex degrees is equal to twice the number of edges.
Planarity
A planar graph is a graph that can be drawn so that no edges intersect each other (except at
vertices).
Is this a planar drawing of a graph? Is the graph planar?
• The drawing is not planar because two edges cross. The graph is
planar because we can make an equivalent planar drawing of it as
shown at the left.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Euler Trails
A trail which includes each edge of G is called an Euler trail of G.
Theorem (Euler, 1736).
A connected graph G with edges is Eulerian if and only if G does not have a vertex of odd
degree.
Corollary. A connected graph G with edges contains an Euler trail if and only if G has
zero or two vertices of odd degree.
The Graph of Kö nigsberg bridges
• The Konigsberg problem which is Finding a path that crosses each bridge exactly
once and returns to the starting point is equivalent to Finding an Euler circuit for
its corresponding graph.
• Euler essentially proved that the Konigsberg graph could not have an Euler
circuit.
• An Eulerian graph is a special type of graph that contains a path that traverses
every edge exactly once. It starts at one vertex (the “initial vertex”), ends at
another (the “terminal vertex”), and visits all edges without any repetition.
• On the other hand, an Euler Circuit is a closed path in a graph. Like an Euler
Path, it covers every edge exactly once but begins and ends at the same
vertex. In this case, the initial and terminal vertex is identical.
• A path in a graph can be thought of as a movement from one vertex
to another by passing through the edges.
• For example, in the Konigsberg graph, one path would be A–B–A–C.
• If a path ends at the same vertex at which it started, it is considered a
closed path, or circuit.
• The path A–D–F–G–E–B–A is a
circuit because it begins and
ends at the same vertex.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Euler Circuit
• A circuit that uses every edge, but never uses the same edge twice, is
called an Euler circuit. The path may cross through vertices more than
once.
• The path B–D–F–G–H– E–C–B–A–D–G–E–B is an Euler circuit.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Eulerian Graph Theorem
• The number of edges that meet at a vertex is called the degree of a vertex.
• A connected graph is Eulerian if and only if every vertex of the graph is of even
degree.
• The Eulerian Graph Theorem guarantees that when all vertices of a graph have
an even degree, an Euler circuit exists, but it does not tell us how to Find one.
a. Vertices C and D are of odd degree.
Example By the Eulerian Graph Theorem, the
graph does not have an Euler circuit.
• Which of the following graphs has an Euler circuit?
b. All vertices are of even degree. By
the Eulerian Graph Theorem, the
graph has an Euler circuit.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Determine whether the graph shown below is Eulerian. If it is, 8ind an Euler circuit. If it is not,
explain how you know.
Each vertex has a degree of 2, 4, or 6, so by
the Eulerian Graph Theorem, the graph is
Eulerian. There are many possible Euler
circuits in this graph. We do not have a formal
method of locating one, so we just use trial
and error. If we label the vertices as shown
below, one Euler circuit is B–A–F–B–E–F–G–E–
D–G–B–D–C–B
Euler Path Theorem
• A path (not necessarily a circuit) that uses every edge once and only once is an
Euler path.
• A connected graph contains an Euler path if and only if the graph has two vertices of
odd degree with all other vertices of even degree. Furthermore, every Euler path
must start at one of the vertices of an odd degree and end at the other.
Example
• A photographer would like to travel across all of the roads shown on
the following map. The photographer will rent a car that need not be
returned to the same city, so the trip can begin in any city. Is it
possible for the photographer to design a trip that traverses all of the
roads exactly once?
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Notice that only two vertices are of odd degree, the cities Alameda and Dover. Thus, we
know that an Euler path exists, and so the photographer can plan a route that travels each
road once. Because (abbreviating the cities) A and D are vertices of odd degrees, the
photographer must start at one of these cities. With a little experimentation, we Eind that
one Euler path is A–B–C–D–B–F–A–G–F–E–D.
Hamiltonian Circuit
• A Hamiltonian circuit is a path that uses each vertex of a graph exactly
once. A graph that contains a Hamiltonian circuit is called
Hamiltonian.
• The path A–B–C–D–E–F–G–A
visits each vertex once and returns
to the starting vertex without visiting
any vertex twice. This path is
a Hamiltonian circuit.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Dirac’s Theorem
• Consider a connected graph with at least three vertices and no
multiple edges. Let n be the number of vertices in the graph. If every
vertex has degree of at least n/2, then the graph must be
Hamiltonian.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Example
• The graph below shows the available flights of a popular airline. (An
edge between two vertices in the graph means that the airline has
direct flights between the two corresponding cities.) Apply Dirac’s
theorem to verify that the following graph is Hamiltonian. Then find a
Hamiltonian circuit. What does the Hamiltonian circuit represent in
terms of flights?
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
There are six vertices in the graph, so n = 6, and every vertex has a degree of at least n/2 =
3. So, by Dirac’s theorem, the graph is Hamiltonian. By trial and error, one Hamiltonian
circuit is Portland–Boise– Butte–Salt Lake City–Reno–Sacramento–Portland, which
represents a sequence of Elights that visits each city and returns to the starting city
without visiting any city twice.
Weighted Graphs
• A weighted graph is a graph in which each edge is associated with a
value, called a weight.
• The value can represent any quantity.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Example
• The table below lists the distances in miles between six popular cities
that a particular airline flies to. Suppose a traveler would like to start
in Chicago, visit the other five cities this airline flies to, and return to
Chicago. Find three different routes that the traveler could follow, and
find the total distance flown for each route.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Solution
• A route that visits each city just once corresponds to a Hamiltonian
circuit.
Chicago–New York–Dallas–
Philadelphia–Atlanta– Washington,
D.C.–Chicago
713 +1374 + 1299 + 670
+ 544 +597 = 5197
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
• Chicago–Philadelphia– Dallas–Washington, D.C.–Atlanta–New York–
Chicago. The total weight of the circuit is
• 665 + 1299 +1185 + 544 +748 + 713 = 5154
• A third route is Chicago–Washington,
D.C.–Dallas–New York–Atlanta–Philadelphia–
Chicago. The total mileage is
• 597 +1185 +1374 +748 +670 +665 = 5239
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg