0% found this document useful (0 votes)
89 views24 pages

Mathematicsunit 6lesson

1) Graph theory is used to model and analyze real-world connections like social networks, transportation routes, and computer networks. 2) A graph consists of vertices (points) connected by edges (lines). It can be used to represent relationships between objects. 3) Euler's analysis of the seven bridges of Königsberg in 1736 laid the foundation for graph theory by proving it was impossible to traverse the bridges without crossing any twice.

Uploaded by

Rami Tounsi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views24 pages

Mathematicsunit 6lesson

1) Graph theory is used to model and analyze real-world connections like social networks, transportation routes, and computer networks. 2) A graph consists of vertices (points) connected by edges (lines). It can be used to represent relationships between objects. 3) Euler's analysis of the seven bridges of Königsberg in 1736 laid the foundation for graph theory by proving it was impossible to traverse the bridges without crossing any twice.

Uploaded by

Rami Tounsi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

UNIT VI : MATHEMATICS OF GRAPH

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 .

LESSON I :FUNDAMENTALS OF GRAPHS THEORY AND EULER CIRCUITS

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.

Fundamentals of Graph Theory

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

 points called vertices


 lines called edges

1. Edges connect two vertices


2. Edges only intersect at vertices.
3. Edges joining a vertex to itself are called loops.

Figure 6.1 is a picture of a graph. List its vertices and edges. Example 6.1.

vertex

•Lourd

• Angel

•Mikee edge

Not a vertex loop

• 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.

Such graph could represent friendships ( or any kind of relationship).

• John • Ben • Lelia • Zaldy

• • •

Fred Amy Keem

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.

Graphs are a structure for describing relationships between objects. 136


Some applications:

 Transactions
 Routes
 Work Distribution
 Networks

Constructing a Graph

Graphs can be represent many different scenarios such as:

 Computer network of a small business


 Flights available on a particular airline between selection of cities
 Game match in a particular game
 Etc

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.

Name Matt Amber Oscar Laura Kayle

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.

Use your graph to answer the following:

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.

Illustrations of undirected graphs are shown below.

•A

•C

•B • • • • •

•E A B C D E
•D

Figure 6.2 a Figure 6.2

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.

Vertex Indegree Outdegree

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.

To illustrate these concepts , consider the following graph: 140

•A •E

•C

•B •D

Figure 6.5

The graph contains a path since A → B → D→ E is a connected graph. Other paths


include A → B →C , B → D → E∧ A → C → B → D → E .A circuit exists in the graph
A → B →C → A .

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.

Equivalent Graphs 141

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:

A. For each of the following undirected graphs , identify the :


1. Vertices
2. Edges
3. Degree of each vertex

• 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

Euler paths and Euler Circuit 142

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.

We know that vertices separated by commas can be used to designate paths. As we


discuss Euler path , you can use pencil to trace these paths. We can also indicate a starting
vertex and numbered edges to illustrate Euler paths. For example , examine the graph in
figure 6.8.

6 • C

Euler path starts here •B


•A 1 5 2 7

•E

•D 8

•G 9 4 3

Euler path ends here • F Figure 6.8

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.

The graph in figure 6.9 , shows an Euler circuit.

6 • C

•B

Euler circuit •A 1 5 2 7

start and ends 10 •E

at A. •D 8

•G 9 4 3

•F

Euler circuit : path A, B, E, F, D,B, C, E, D, G, A , with numbers 1 to 10 .

Exercise: Which of the following graphs has an Euler circuit?


a. •A b. •A

•B • E B • •E

•C •D •C •D

Eulerian Graph Theorem

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.

EULER’S PATH THEOREM

The following statements are true for connected graphs:

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.

Example : Using Euler’s Theorem.

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.

Even vertex; degree is 2

•A

Even vertex ; • B •C even vertex ; degree is 4

Degree is 4

Odd vertex: degree,3 •D •E odd vertex : degree is 3

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

Euler path starts here • D •E Euler path ends here

LESSON II : WEIGHTED GRAPHS 146

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.

Hamilton Paths and Hamilton Circuits

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.

Examples of Hamilton paths and Hamilton circuits

a. Find a Hamilton path for the graph in figure 6.10.


b. Find a Hamilton circuit for the graph in figure 6.10 • A •B

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

Figure 6.11 figure 6.12

The Number of Hamilton Circuits in a Complete Graph

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.

A, B, C , D, A and B, C, D, A , B and C, D, A , B, C and D, A , B , C, D

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

The number of Hamilton circuits in a complete graph with n vertices is

(n -1)!

- the factorial notation is useful in determining the number of ordered arrangements , or


permutation.

Example :

Determine the number of Hamilton circuits in a complete graph with

a. four vertices b. five vertices c. eight vertices 148

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.

a. A complete graph with four vertices has ( 4-1)! = 3! = 3· 2· 1 = 6 Hamilton circuits


b. A complete graph with five vertices has ( 5-1)! = 4! = 4·3·2·1 = 24 Hamilton
circuits.
c. A complete graph with eight vertices has
( 8-1)! = 7! = 7·6·5·4·3·2·1 = 5040 Hamilton circuits

Example:

Find Hamiltonian Circuits in a Weighted Graph

Place/State Chicag New York Washington Philadelphia Atlanta Dallas


o D.C.

Chicago - 713 597 665 585 803

New York 713 - No flights No flights 748 1374

Washington 597 No flights - No flights 544 1185


D.C.

Philadelphia 665 No flights No flights - 670 1299

Atlanta 585 748 544 � - No


670 flights
Dallas 803 1374 1185 1299 No -
flights

Solution: 149

•New York

713

•Chicago 748

597 • Washington D.C.

803 585 544

1374 1185 665

Dallas • 1299 • Philadelphia

• 670

Atlanta

Figure 6.13

By trial and error , identify the routes

Study Tip :
(n a weighted graph , the lengths of the edges do not have to be proportional to the
weights).

� Is there a way we can find the very best route to take?


� Unfortunately , there is no known shortcut for finding the optimal Hamilton circuit
in a weighted graph.

Weighted Graphs and the Traveling Salesperson Problem

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

Table 6.1 One –Way Airfares

Cities A B C D

A * $190 $124 $157

B $190 * $126 $155

C $124 $126 * $179

D $157 $155 $179 *

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.

Traveling salesperson problem is a problem of finding a Hamilton circuit in a complete


weighted graph for which the sum of the weights of the edges is a minimum. Such a
Hamilton circuit is called the optimal Hamilton circuit or the optimal solution.

One method for finding an optimal Hamilton circuit is called Brute Force Method.

The Brute Force Method of Solving Traveling Salesperson Problems

The optimal solution is found using the following steps:

1. Model the problem with a complete, weighted graph.


2. Make a list of all possible Hamilton circuits.
3. Determine the sum of the weights of the edges of each of these Hamilton circuits.
4. The Hamilton circuit is with the minimum sum of weights is the optimal solution.

Example : Using the Brute Force Method 151

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

157 155 126

•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.

Table 6.2 Possible Hamilton circuits and their total cost

Hamilton Circuit Sum of the Weights of the edges Total cost

A, B, C, D, A 190+126+179+157 = $652

A,B,D,C,A 190+155+179 + 124 = $648

A ,C , B , D , A 124+126+155+157 = $562

A,C,D,B,A 124+179+155+190 = $648

A,D,B,C,A 157+155+126+124 = $562

A,D,C,B,A 157+179+126+190 = $652

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

Optimal solution : Optimal solution :

A, C, B , D , A A,D,B,C,A

• A •B A • •B
•D •C •D •C

a) Fly from A to C to B to D and b) fly from A to D to B to C and


then back to A. then back to A.

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

LESSON III : EULER FOMULA 153

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.

• • • •

• • redraw the edge colored red • •

Example 2; Show that the graph is planar.

•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 155

Euler noticed a connection between various features of planar graphs. In addition to


edges and vertices , he looked at faces of a graph. In a planar drawing of a graph , the edges
divide the graph into different regions called faces. The region surrounding the graph , or
the exterior , is also considered a face , called the infinite face. ( see the figure ). The
following relationship , called Euler’s formula , is always true.

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 Euler’s Formula in the graph

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

• •

Verify the Euler’s formula: •

You might also like