Mathematicsunit 6lesson
Mathematicsunit 6lesson
In this unit , you will learn how to analyze and solve a variety of problems , such
as how to find the least expensive route of travel on a vacation , how to determine the most
efficient order in which to run errands and how to schedule meetings at a conference so
that no one has two required meetings at the same time.
The methods we will use to study these problems can be traced back to an old
recreational puzzle. In the early eighteenth century , the Pregel River in a city called
Konigsberg ( located in modern-day Russia and now called connected four Kaliningrad )
surrounded an island before splitting in two. Seven bridges crossed the river and
connected four different land areas .
Many citizens of the time attempted to take a stroll that would lead them across
each bridge and return them to the starting point without traversing the same bridge
twice. None of them could do it , no matter where they chose to start.
In 1736 the Swiss mathematician Leonard Euler ( 1707 – 1783 ) proved that it is ,
in fact , impossible to walk such a path. His analysis of the challenge laid the groundwork
for a branch of mathematics known as graph theory. We will investigate how Euler
approached the problem of the seven bridges of Konisberg .
Introduction to Graphs
Think of all the various connections we experience in our lives – friends are connected
on Facebook , cities are connected by roads, computers are connected across the Internet. A
branch of Mathematics called graph theory illustrate and analyzes connections such as
these.
For example , the diagram in the Fig. 6.1 could represent friends that are connected on
Facebook. Each dot represents a person , and a line segment connecting two dots means
that those two people are friends on Facebook. This type of diagram is called a graph. Note
this is a different kind of graph from the graph of a function.
134
GRAPHS consist of
Figure 6.1 is a picture of a graph. List its vertices and edges. Example 6.1.
vertex
•Lourd
• Angel
•Mikee edge
• RA • Jerome
•Joshua
135
Take note: Vertices are always clearly indicated with a “ dot “. Edges that intersect with no
marked vertex are considered to cross over each other without touching. Not every point
where two edges cross is a vertex.
Example 6.2: this is also a graph. The vertices just happen to have people’s names.
• • •
Now check out the graph below. What can you say about it in comparison to the previous
figure.
• John
• Fred
• Lelia
• amy
• Keem • Zaldy
Ben •
One graph may be drawn in ( infinitely ) many ways , but it always provides us with the
same information.
Transactions
Routes
Work Distribution
Networks
Constructing a Graph
Table 6.1 is a list of five students at a college. An “ x” indicates that two students
participate in the same study group this semester.
Matt - x x
Amber x - x x
Oscar x - X
Laura x x -
Kayle x -
Draw a graph that represents this information where each vertex represents a student and
an edge connects two vertices if the corresponding students study together.
1. Which student is involved in the most study groups with the others?
2. Which student has only one study group in common with the others?
3. How many study group does Laura have in common with the others ?
Solution:
• Amber 137
• Matt • Oscar
• Kayle • Laura
We draw five vertices ( in any configuration we wish ) to represent the five students, abd
connect vertices with edges according to the table.
Answer:
1.The vertex corresponding to Amber is connected to more edges than the others , so she is
involved with more study groups ( three) than the others.
2. Kayle is the only student with one study group in common , as her vertex is the only one
connected to just one edge.
3. Laura’s vertex is connected to two edges , so she shares two study groups with the
others.
Terminologies:
A graph is a set of points called vertices and line segments or curves are called edges that
connect vertices, then the graph is directed. Otherwise , it is called an undirected. The
degree of a vertex is the number of edges connected to it. An edge that starts and ends at
the same vertex is called a loop.
•A
•C
•B • • • • •
•E A B C D E
•D
138
Notice that both graphs are the same because they have the vertices and edges. The
graphs shows that there are 5 vertices: A , B , C , D , and E and there are four edges: {A, B},
{B, C }, { B,D} ,and { B, E }. This graph is undirected because { A, B } = { B, A }. The degree of
each vertex is shown below:
Vertex A B C D E
Degree 1 4 1 1 1
Now a directed graph is shown below. It can be seen that (B, A ) is an ordered pair. The
edge from A to B is called indegree of vertex A. The edge from B to A is called the outdegree
of the vertex B. A vertex with an even number of edges attached to it is an even vertex. A
vertex with an odd number of edges attached to it is an odd vertex. Two vertices in a graph
are said to be adjacent vertices if there is at least one edge connecting them. It is helpful to
think of adjacent vertices as connected vertices.
•B
•A •C
•G
•D
•F
•E
Figure 6.3
139
The indegree and outdegree of the vertices are shown below. Note that the sum of the
indegree and the outdegree of each vertex is the total number of edges connected to that
vertex.
A 2 0
B 0 2
C 1 1
D 0 2
E 2 0
F 0 3
G 3 0
If two vertices are connected by more than one edge , then the edges are called
multiple edges. The graph is called multigraph. A graph with no loops and no multiple
edges , then it is a simple graph. If there are no edges connecting each of the vertices , then
it is a Null graph. An example of a simple graph is shown in figure 6.4a , and an example of a
null graph is shown in figure 6.4b.
•B B •
•A •C A • •C
•D
Figure 6.4a Figure 6.4b
A path is a sequence of vertices such that they are connected by edges. A circuit is a
path that starts and ends at the same vertex.
The words connected and disconnected are used to describe a graph. A graph is
connected if for any two of its vertices there is at least one path connecting them. Thus , a
graph is connected if it consists of one piece. If a graph is not connected, it is said to be
disconnected. A disconnected graph is made up of pieces that are by themselves connected.
Such pieces are called components of the graph. A bridge is an edge that if removed from a
connected graph would leave behind a disconnected graph.
•A •E
•C
•B •D
Figure 6.5
In a graph , the important information is which vertices are connected by edges. Two
graphs are equivalent if they have the same number of vertices connected to each other in
the same way. The placement of the vertices and the shapes of the edges are unimportant.
Graphs can be used to represent many different scenarios. For instance , which is a
simple graph ? Multigraph ? and a Null graph ?
•
D • •B • • •
• •
A • •C • • • •
a. b. c.
a. •A b. c.
•A • C •B
• B A • •E
B • D • • E C • •D
C • •E
•D
In the figures , the vertices are A, B , C , D and E. All graphs have an edge that connects
vertex B, an edge that connects vertex B to all the vertices. Because the graphs have the
same number of vertices connected to each other in the same way , they are equivalent.
Exercise Set:
• F •L
G • •H • I •M •N
• J •O •P
•Q
B. For the directed graph below, identify the indegree and outdegree of each vertex.
A B C
• • •
• • •
D E F
It was from the Swiss mathematician Leonard Euler that graph theory started to gain
worldwide attention. As such , he was able to develop many concepts including the Euler’s
circuit and Euler’s formula.
We have seen that vertices separated by commas is a sequence of adjacent vertices and
the edges connecting them. Recall that an edge can be part of a path only once. If a path
passes through each edge of a graph exactly one time, it is called an Euler path.
An Euler path is a path that travels through every edge of a graph once and only once. Each
edge must be traveled and no edge can be retraced. A path is an alternating sequence of
vertices and edges.
6 • C
•E
•D 8
•G 9 4 3
The path A, B, E, F, D,B, C, E, D, G is an Euler path because each edge is traveled once. Trace
this path with your pencil. Now try using the numbers along the edges.
143
We will use vertices as well as numbered edges to designate Euler paths. Do you see why
the Euler path in figure 6.8 is not a circuit? A circuit must begin and end at the same vertex.
The Euler path in figure 6.8 begins at vertex a and ends at vertex G.
If an Euler path begins and ends at the same vertex , it is a closed path or a circuit / cycle.
A circuit that travels through every edge of a graph once and only once, or a circuit that
uses every edge , but never uses the same edge twice , is CALLED AN EULER CIRCUIT. Like
all circuits , an Euler must begin and end at the same vertex.
6 • C
•B
Euler circuit •A 1 5 2 7
at A. •D 8
•G 9 4 3
•F
•B • E B • •E
•C •D •C •D
144
A connected graph is Eulerian if and only if every vertex of the graph is of even degree.
Exercise:
Determine whether the graph shown below is Eulerian. If it is , find the Euler circuit. If it is
not, explain how you know. The number beside each vertex indicates the degree of the
vertex.
•6
•2 •2
•4
4 • •4
•4
Notice that every Euler circuit is an Euler path. However , not every path is an Euler circuit.
Some graphs have no Euler paths. Other paths have several Euler paths. Furthermore,
some graphs with Euler paths have no Euler circuits. Euler’s Path Theorem is used to
determine if a graph contains Euler path or Euler circuit.
1. If a graph has exactly two odd vertices , then it has at least one Euler path, but no
Euler circuit. Each Euler path must start at one of the odd vertices and end at the
other one.
2. If a graph has no odd vertices( all even vertices ), it has at least one Euler circuit
(which, by definition , also an Euler path ). An Euler circuit can start and end at any
vertex.
145
3. If a graph has more the two odd vertices , then it has no Euler paths and no Euler
circuits.
a. Explain why the graph in figure 6.10 has at least on Euler path.
b. Use trial and error to find one such path.
•A
Degree is 4
Figure 6.10
Solution:
a. We count the number of edges at each vertex to determine if the vertex is odd or even.
We see that there are exactly two odd vertices , namely D and E, meaning there are 3
edges connected at vertex D and E. By the first statement in Euler’s Theorem , the
graph has at least one Euler path , but no Euler circuit.
b. Euler’s Path Theorem tells us that a possible Euler path must start at one of the odd
vertices and end at the other one. We will use trial and error to determine an Euler
path, starting at vertex D and ending at vertex E. Trace this path and verify the
numbers along the edges. An Euler path : D, C, B, E, C, A, B, D, E.
•A
6 5
• B 2 •C
7 1 3 4
A weighted graph is a graph in which each edge is associated with a value , called a
weight. The value can represent nay quantity we desire.
Trying to find the best way to deliver packages around the town or planning the best
route by which to run a series of errands can be modeled and solved using paths and
circuits that pass through each vertex of a graph exactly once. These kinds of paths and
circuits are named after the Irish mathematician William Rowan Hamilton ( 1805 – 1865 ).
A path that passes through each vertex of a graph exactly once is called Hamilton path. If a
Hamilton path begins and ends at the same vertex and passes through all other vertices
exactly once it is called Hamilton circuit.
E•
• D •C
Solution :
a. A Hamilton path must pass through each vertex exactly once. The graph has many
Hamilton paths. An example of such path is ; A, B , C , D , E.
b. A Hamilton circuit must pass through every vertex exactly once and begin and end
at the same vertex. The graph have many Hamilton circuits. An example of such
circuit is ; A, B, C ,D , E , A.
The graph in figure 6.10 has many Hamilton paths and circuits. However, because it has
four vertices of odd degree , it has no Euler paths and no Euler circuits. When it comes to
Hamilton circuits and Euler circuits , a graph can have one or the other , or both , or neither.
A complete graph is a graph that has an edge between each pair of vertices. Can you see
that the graph in figure 6.11 is not complete ? There is no edge between vertex A and D. Nor
is there an edge between vertex B and C. Complete graphs are significant because every
147
complete graph with three or more vertices has Hamilton circuit. The graph in figure 6.11
is not complete and no has Hamilton circuits.
• A • B •A •B
•E
•D •C • D •D
The graph in figure 6.12 has an edge between each pair of its four vertices. Thus , the graph
is complete and has a Hamilton circuit. For example , one Hamilton circuit is
A, B ,C , D, A.
Any two circuits that pass through the same vertices in the same order will be considered
to be the same. For example , here are four different sequences of letters that produce the
same Hamilton circuit on the graph in figure 6.12.
In order to avoid this duplication , in forming a Hamilton circuit , we can always assume
that it begins at A.
There are six different , or unique , Hamilton circuits for the graph with four vertices.
The number of Hamilton circuits in a complete graphs
(n -1)!
Example :
Solution: In each case , we use the expression ( n- 1 )!. For four vertices substitute 4 for
n in the expression. For five and eight vertices , substitute 5 and 8, respectively, for n.
Example:
Solution: 149
•New York
713
•Chicago 748
• 670
Atlanta
Figure 6.13
Study Tip :
(n a weighted graph , the lengths of the edges do not have to be proportional to the
weights).
Sales directors for large companies are often required to visit regional offices in a number
of different cities. How can these visits be scheduled in the cheapest possible way ?
For example , a sales director who lives in city A is required to fly to regional offices in
cities B , C , and D. Other that starting and ending the trip in city A, there are no restrictions
as to the order in which the other three cities are visited.
The one-way fares between each of the four cities are given in table 6.1 . A graph that
models this information is shown in Figure 6.14 . The vertices represented cities . The
airfare between each pair of cities is shown as a number on the respective edge.
150
Cities A B C D
Figure 6.14
The weight to edge AB is 190 , modeling a $190 airfare from city A to city B . The sales
director needs to find the least expensive way to visit cities B , C , and D once , and return
home to A. Our goal is to find the Hamilton circuit with the lowest associated cost.
( understanding the information in a weighted graph ) Use the weighted graph in figure
6.14 to find the cost of the trip for Hamilton circuit A, B, C, D ,and A.
Solution: The trip described by the Hamilton circuit A, B, C ,D and A involves the sum of
four costs:
$190 + $155 + $179 + $124 = $ 648 , thus, the cost of the trip is $648.
One method for finding an optimal Hamilton circuit is called Brute Force Method.
Use the weighted graph in figure 6.14 , to find the optimal solution. Describe what this
means for the sales direction who starts at A, flies once to each of B, C, and D, and returns
home to A.
•A 190 •B
124
•D 170 •C
Solution:
The graph has four vertices. Thus , using ( n – 1 ) ! , there are ( 4 - 1 )! = 3! = 3·2·1 = 6
possible Hamilton circuits. The six possible Hamilton circuits and their total costs are
shown in table 6.2.
A, B, C, D, A 190+126+179+157 = $652
A ,C , B , D , A 124+126+155+157 = $562
In the last two column indicates that two Hamilton circuits have the minimum cost of $
562. The optimal solution is either
A,C,B,D,A or A , D, B , C , A
For the sales director , this means that either route in figure 6.15 is the least expensive
way to visit the regional offices in cities B , C , and D. Notice that the route 6.15(b) involves
visiting the cities in the reverse order of the route in figure 6.15(a). Although these are
different Hamilton circuits, because the one-way airfares are the same in either direction ,
the cost is the same regardless of the direction flown.
152
A, C, B , D , A A,D,B,C,A
• A •B A • •B
•D •C •D •C
Exercise :
Use the Brute Force Method to find the optimal solution for the complete, weighted graph
in the figure. List Hamilton circuits .
•A
30 20
70 •D
50 10
• C 15 •B
Planar graph
A planar graph is a graph that can be drawn so that no edges intersect each other ( except
vertices ).
If the graph drawn in such a way that no edges cross , we say that we have a planar
drawing of a graph.
Example :Question ; 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 right.
• • • •
•A
A • •C
E • • D
As given , the graph has several interesting edges. However , we can redraw the graph in an
equivalent form in which no edges touch except at vertices by redrawing the two red edges
shown below. To verify that the second graph is equivalent to the first , we can label
154
The vertices and check that the edges join the same vertices in each graph. Because the
given graph is equivalent to a graph whose edges do not intersect , the graph is planar.
• B •B
A • •C A • •C
• E • F E • •F
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
Count the number of edges , vertices , and faces in the planar graph , and then verify Euler’s
formula.
There are seven edges , five vertices , and four faces ( counting the infinite face ) in the
graph. Thus,
v + f =e + 2 ; 5 + 4 = e + 2 ; 9 - 2 = e = 7
• •