Professional Documents
Culture Documents
Graphs
Graphs
MODERN WORLD
Textbook: Aufmann, R., Lockwood, J., Nation, R., Clegg, D., Epp, S., Abad, E. Jr. Mathematics
in the Modern World. (Rex Book Store, Inc., Manila, Philippines). 2018.
VI. Graph Theory
Seven Bridges of Kӧnigsberg, Euler and Graph Theory
(Courtesy of google.com)
The problem was to devise a walk through
the city that would cross each of those
bridges once and only once.
Cebu City - X X X
Minglanilla - X
Mandaue City X - X X
Consolacion X - X
Talisay City X X -
Lapu-Lapu City X X X
Cordova X X -
• In general, a graph can include vertices that are not joined to any edges,
but all edges must begin and end at vertices.
• If two or more edges connect the same vertices, they are called multiple
edges.
• If an edge begins and ends at the same vertex, it is called a loop.
• A graph is called connected if any vertex can be reached from any other
vertex by tracing along edges.
• A connected graph in which every possible edge is drawn between
vertices and without any multiple edges is called a complete graph.
• Two graphs G=(V,E) and G'=(V',E') are isomorphic if there exists a one-to-
one and onto function β:V→V' such that for any x,y ϵ V:
{x,y} ϵ E if and only if {β(x), β(y)} ϵ E'.
• Example: Determine whether the following graphs are isomorphic.
B C
A B C D
A D
B B A
C E
C D E
Euler Circuits
• A path is a graph G=(V,E) such that V={x1, x2, x3, ... , xn-2, xn-1, xn} and
E={{x1,x2}, {x2,x3}, ... , {xn-2,xn-1}, {xn-1,xn}}.
• If a path ends at the same vertex at which it started, it is called a closed
path or a circuit.
• Note: a path or a circuit is sometimes useful when considered as a part of
a “bigger” graph (this is the concept of a “subgraph”).
• In a graph, a circuit that uses every edge but never uses the same edge
twice is called an Euler circuit.
• Example: Find an Euler circuit in the following graph.
A B C D
E F G H
• Example: Find an Euler circuit in the following graph.
A B
C D
D E
• A graph with an Euler circuit s called an Eulerian graph.
• Eulerian Graph Theorem:
A connected graph is Eulerian if and only if every vertex of the graph
is of even degree.
• Example: Use the Eulerian Graph Theorem to verify our two examples above on the
existence of Eulerian circuits.
• Example: Recalling the problem of 7 bridges of Kӧnigsberg, was it possible for the people to
take a stroll that would lead them across each bridge and return them to the starting point
without traversing the same bridge twice?
• In a graph, a path that uses every edge once and only once is called an
Euler path.
• Example: Determine if there exists an Euler path of the following graph.
A B
C D
• A Version of Euler Path Theorem:
Let G be a connected graph with two distinct vertices x and y of odd
degrees. G has an Euler path from vertex x to vertex y if and only
if x and y are the only vertices of odd degrees.
• Example: Verify our last example on the existence of an Euler path using this theorem.
• Example: Recalling the problem of 7 bridges of Kӧnigsberg, was it possible for the people to
take a stroll such that they start in one of the points and end up with a different point with the
condition that they cross each bridge without traversing the same bridge twice?
• Example: A bicyclist wants to mountain
bike through all the trails of a national park.
A map of the park is shown on the right.
Because the bicyclist will be dropped off in
the morning by friends and picked up in
the evening, she does not have a
preference for where she begins and ends
her ride. Is it possible for the cyclist to
traverse all of the trails without repeating
any portions of her trip?
• Example: The floor plan of a warehouse is
illustrated on the right. Use a graph to
represent the floor plan, and answer the
following questions: Is it possible to walk
through the warehouse so that you pass
through every doorway once but not twice?
Does it matter whether you return to the
starting point?
Hamiltonian Circuits
• A Hamiltonian circuit ina a given graph is a path that begins and ends at
the same vertex and passes through each vertex of a graph exactly once.
A graph that contains a Hamiltonian circuit is called a Hamiltonian graph.
• Example: Which of the following graphs is a Hamiltonian graph?
A B E F J K
I
C D G H L M N
Lapu-Lapu City Santa Fe Panglao Pasay City Bacolod City Angeles City (Clark)
(Bantayan)
Lapu-Lapu City - X X X
Santa Fe (Bantayan) X - X X X
Panglao X - X X
Pasay City X - X X
Bacolod City X X X X - X
Cebu City Carcar City Mandaue City Talisay Lapu- Danao City Bogo City
City Lapu City
Cebu City - X X X X
Carcar City - X X X
Mandaue City X X - X
Talisay City X - X X
Lapu-Lapu City X X - X
Danao City X X X -
Bogo City X X X -
Weighted Graphs
• A weighted graph is a graph in which each edge is associated with a
value called weight.
• Example:
1
2
6 3
• Example: Find good routes from the previous examples using the edge-picking algorithm.
• Example: Brian needs to visit the pet store, the shopping mall, the local farmers market,
and the pharmacy. His estimated driving times (in minutes) between the locations are
given in the following table. Use the greedy algorithm and edge-picking algorithm to find
two possible routes, starting and ending at home, that will help Brian minimize his total
travel time.
• Example: How many faces are there in each of the following graph?
• Euler's Formula
In a connected planar graph drawn with no intersecting edges, let v
be the number of vertices, e the number of edges, and f the number
of faces. Then
v + f = e + 2.
• Example: Verify the graphs from the previous example using the Euler's formula.
• Example: Determine the number of faces of the following graph and verify using the Euler's
formula.
Graph Coloring
• Francis Guthrie, a South African mathematician and botanist, tried to color
a map of the countries of England. He wanted that countries sharing a
common border to have different colors. He then noticed that four colors
are needed to color the map and so he postulated that four colors are
sufficient to color any map. This is now known as the four-color problem.
• Example: 4-Coloring of the US map.
• Example: Suppose the following is a map of a province with different cities. Color the map
such that two cities sharing a common boundary have different colors.
• If n colors are enough to color the vertices of a graph such that no two adjacent vertices
have the same color, we say that the graph is n-colorable.
• Four-Color Theorem
Every planar graph is 4-colorable.
• Example: Consider the map of Central Cebu Protected Landscape (CCPL) on the
following page. Construct a graph such that each city/municipality included in CCPL is
represented by a vertex and two vertices are connected if the corresponding
cities/municipalities share the same boundary. Color the graph and decide whether it is 2-
colorable, 3-colorable or 4-colorable.
• The minimum number of colors needed to color a graph so that no edge
connects vertices of the same color is called the chromatic number of
the graph.
• 2-Colorable Graph Theorem
A graph is 2-colorable if and only if it has no circuits that consist of
an odd number of vertices.
• Example: Determine if each of the following graphs is 2-colorable or not.
Applications of Graph Coloring
• Example: Eight different school clubs want to schedule meetings on the last day of the
semester. Some club members, however, belong to more than one of these clubs, so clubs
that share the same members cannot meet at the same time. How many different time slots
are required so that all members can attend all meetings? Clubs that have a member in
common are indicated with an “X” in the table below.
Kahugpungan sa Student Debate Honor Student Mathematics Campus Campus
Pinulungang Government Club Society Newspaper Circle Democrats Republicans
Binisaya
Kahugpungan sa - X X X X
Pinulungang Binisaya
Student Government X - X X X
Debate Club X - X X X
Honor Society X X X - X X
Student Newspaper X X - X X
Mathematics Circle X X X - X X
Campus Democrats X X X -
Campus Republicans X X X -
• Example: Six film students have collaborated on the creation of five films.
Film A was produced by Brian, Chris, and Damon.
Film B was produced by Allison and Fernando.
Film C was produced by Damon, Erin, and Fernando.
Film D was produced by Brian and Erin.
Film E was produced by Brian, Chris,and Erin.
The college is scheduling a one-day film festival where each film will be shown once and the
producers of each film will attend and participate in a discussion afterward. The college has
several screening rooms available and two hours will be allotted for each film. If the showings
begin at noon, create a screening schedule that allows the festival to end as early as possible
while assuming that all the producers of each film can attend that film's screening.
• Example: Five classes at an elementary school have arranged a tour at a zoo where the
students get to feed the animals.
Class 1 wants to feed the elephants, giraffes, and hippos.
Class 2 wants to feed the monkeys, rhinos, and elephants.
Class 3 wants to feed the monkeys, deer, and sea lions.
Class 4 wants to feed the parrots, giraffes, and polar bears.
Class 5 wants to feed the sea lions, hippos, and polar bears.
If the zoo allows animals to be fed only once a day by one class of students, can the tour
be accomplished in two days? If not, how many days will be required? (Assume that each
class will visit the zoo only on one day).