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

Graphs and Euler Circuits

The document discusses graphs and Euler circuits. It defines what a graph is and provides examples of graphs representing different scenarios. It also defines what an Euler circuit is and discusses the Konigsberg bridge problem. The document introduces concepts like vertices, edges, paths, circuits, degrees of vertices, and the theorems for Eulerian and Euler graphs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views80 pages

Graphs and Euler Circuits

The document discusses graphs and Euler circuits. It defines what a graph is and provides examples of graphs representing different scenarios. It also defines what an Euler circuit is and discusses the Konigsberg bridge problem. The document introduces concepts like vertices, edges, paths, circuits, degrees of vertices, and the theorems for Eulerian and Euler graphs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 80

GRAPHS AND

EULER
CIRCUITS
INTRODUCTION TO
GRAPHS
Think of all various connection 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 illustrates and analyzes
connection such as there.
For example, the diagram below represent friends that are
connected on Facebook. Each dots represent a person and a
line segment connecting two dots means that those two
people are friends on Facebook
Elsa ● Hether ●Jared

● ●
Amy Ben ●
Paul

Graphs can be used to represent many different scenarios.


For instance, the two graphs below are the same graph as in
previous example but in different context.
Examples:
A. Each vertex represents a baseball team, and an
edges connecting two vertices might mean that the two
teams played against each other during the current
season. The graph in part.

White sox

Braves Cardinals

● ●
Yankees Mets ●
Giants
B. It could because to represent the flights available on a
particular airlines between a selection of cities; each vertices
represents a city and an edge connecting two cities means
that there is a direct flight between the two cities.

San Francisco New York


● Chicago ●

● ● ●
Los Angeles Dallas Atlanta
Constructing a graphs
The following table list five students at a college. An “X”
indicates that the two students participate in the same study
group this semester.
A. Draw a graph that represents this information where each
vertex represents a students and an edge connects two
vertices if the corresponding study together.

Amber

Matt
● ●Oscar

● ●
Kayla Laura
Solution:
The vertex corresponding to Amber is connected to more
edges than the others, so she is involved with more study
groups than the others. Kayla the only student with one
study in common, as her vertex is the only one connected to
just one edge.
Amber

Matt ● ● Oscar

● ●
Kayla Laura
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 edges is
drawn between vertices is called a complete graph.
This graph has five vertices but no edges. It is not
connected.





This is a connected graph that has a pair of multiple edges.
Note that two edges cross in the center, but there is no vertex
there. Unless a dot is drawn, the edges are considered to pass
over each other without touching.

● ●



This graph is not connected; it consist of two different
sections. It also contains a loop.


● ●



This is a complete graph with five vertices.

● ●

● ●
Note that it does not matter whether the edges are drawn
straight or curved and their length are not important. Not is
the placement of the vertices important. All that matters is
which vertices are connected by edges.
Consequently, the three graphs shown below are considered
equivalent graphs, because of the edges from the same
connections of vertices in each graph.
A
● A C B
● ● ●
B● B
● A
● ●E
C ● ● ● D● ● ● ●
E E C D
D

If you have difficulty seeing these graphs are equivalent, use the
labeled vertices to compare each graphs. Note that in each case,
vertex B has an edge connecting it to each of the other four
vertices and no other edges exist.
EQUIVALENT GRAPHS
Determine whether the following graphs are equivalent.

D ●C
A● ●B ●
E
● ●
E
● ●C ● ●
D B A
Solution:
Despite the fact that the two graphs have different
arrangements of vertices and edges, they are equivalent. To
illustrate, we examine the edges of each graph.

The first graph contains six edges; we can list them by


indicating which two vertices they connect. The edges are
AC, AE, BD, BE, CE and DE.

If we do the same for the second graph, we get the same six
edges. Because the two graph represent the same
connections among the vertices, they are equivalent.
EULER CIRCUIT

- is a closed path that uses every edge, but never uses the
same edge twice . The path may cross through vertices
more than once.

-An Euler circuit in graph is a circuit that uses every edge of


the graph exactly once.
Konigsberg bridge Problem

There were seven bridges joining various parts of the


city. The following problem was well known.

Is it possible for a citizen of Konigsberg to take a


stroll through the city, crossing each bridge exactly
once, and beginning and ending at the same place?
Konigsberg bridge Problem
In terms of a graph, the original problem can be stated as
follows:

Can we start at any vertex, move through each edge once


(but not more than once), and return to the starting vertex?

Again, try it with pencil and paper. Every attempt seems to


end in failure. Before we can examine how Euler proved this
task impossible, we need to establish some terminology.

A path in a graph can be thought of as a movement from one


vertex to another by traversing edges. We can refer to our
movement by vertex letters.
For example, in the graph in 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.

For the graph in the path A-D-F-G-E-B-A is a circuit


because begins and ends at the same vertex. The path
A-D-F-G-E-H is not a circuit, as the path ends at a
different vertex than the one it started at.
Example: B
A C

D E

F H
G
The path B-D-F-G-H E-C-B-A-D-G-E-B in Figure 6.5 is an Euler
circuit. It begins and ends at the same vertex and uses each edge
exactly once. (Trace the path with your pencil to verify!) The path
A-B-C-E-H-G-E-B-D-A is not an Euler circuit: The path begins and
ends at the same vertex but it does not use edges DF, DG, or FG.
The path A-B-C-E-H-G-F-D A-B-E-G-D-A begins and ends at A
but uses edges AB and AD twice so it is not an Euler circuit.
Eulerian Graph Theorem
A connected graph is Eulerian if and only if every
vertex of the graph is of even degree.

Example: Identifying Euler Graphs


Which of the following graph has an euler circuit?
A
a A

B E
B

C D
C D
Solution

a. Vertices C and D are of odd degree. By the Eulerian graph


theorem, the graph does not have an Euler circuit

b. All vertices are of even degree. By the Eulerian graphs


theorem, the graph has an Euler circuit.
A B
C

G
F D

Solution:
Each vertex is of even degree (2, 4, or 6), so by the Eulerian
graph theorem. the graph ix Eulerian. There are many possible
Euler circuits in this graph. We do not have! a formal method of
locating one, but by trial and error. one Euler circuit is B-A-F-B-
E-F-G-E-D-G-B-D-C-B,
Euler Path Theorem

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 odd degree and cod at the other.
Example #1:

B D B

C
A C
A
D
Example #2
One Euler path for the above graph is F. A. B. C. F.
E. C. D. E as shown below.
A B A B

F C F C

E D E D
This Euler path travels every edge once and only once and starts
and ends at different vertices. This graph cannot have an Euler
circuit since no Euler path can start and end at the same vertex
without crossing over at least one edge more than once.
NOTE: Leonhard Euler (oral) (1707-1783) was one of the most
prolific mathematicians of all time. He wrote hundreds of papers in
almost every area of mathematics. In one of these papers, published in
1736, Euler proved that it was impossible to traverse each of the
bridges of Konigsberg exactly once and return to the starting point.

Although he did not present his paper in the language of graph theory,
his arguments were equivalent to our discussion in this section. In fact,
his proof was more general than just a proof of the Königsberg bridges
problem, and it can be considered the first paper in graph theory.
Weighted Graph
Hamiltonian Circuit

A Hamiltonian circuit is a paths that begins


and ends of the same vertex and passes
through each vertex of a graph exactly
once. A graph that contains a Hamiltonian
circuit is called Hamiltonian.
Find a Hamiltonian Circuits for this graph.

So here we want to find a Hamiltonian circuit for this


graph.
Now, you might remember an Euler circuit
was one that covered every edge exactly one
and we didn’t care about the vertices.

Hamiltonian circuit is a different. In this case,


we want to visit every vertex once with no
repeats.
There is a Hamiltonian circuit on this graph it visit every
vertex exactly once with no repeats and it again. It doesn’t
matter that we haven’t visited all the edges. All we care about
is the vertices.
We must be careful, however, if our graph does not meet
the requirements of this theorem, is still might be
Hamiltonian. Dirac’s theorem does not help us in this
case.
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 we desire. For each Hamiltonian circuit in the weighted
graph. The sum of the weight along the edges traversed gives
the total distance traveled along the route.
Example #2: Find the Hamiltonian Circuit in a Weighted
Graph

The table in the next slide is a list the distances in miles


between six popular cities that a particular airline flies to,
start in Chicago, visit the other five cities, this airlines flies to,
and return to Chicago. Find the three different routes that the
traveler could follow, and find the total distance flown for
each route.
Chicago New York Washington Philadelphia Atlanta Dallas
, DC
CHICAGO _ 713 597 665 585 803
713 _ NO NO 748 1374
NEW YORK
FLIGHTS FLIGHTS

WASHINGTON, DC 597 NO _ NO 544 1185


FLIGHTS FLIGHTS
PHILADELPHIA 665 NO NO _ 670 1299
FLIGHTS FLIGHTS
ATLANTA 585 748 544 670 _ NO
FLIGHTS
DALLAS 803 1374 1185 1299 NO _
FLIGHTS

Solution:
The various option will be simple to analyze if we organized the
information in a graph, begin by letting each city be represent by a
vertex. Draw an edge between two vertices.
New York

713

Chicago 597 Washington, DC


748

803 544
1185
1374
665
Dallas 1299 Philadelphia

585
670

Atlanta
A route that visits each city just one corresponds to a
Hamiltonian circuit. Beginning at Chicago, one such circuit is
Chicago-New York-Dallas-Philadelphia-Atlanta-Washington,
D.C.-Chicago. By adding a weights of ach edges in the circuit,
we see that the total number of miles traveled is

713 + 1374 + 1299 + 670 + 544 + 597 = 5197

By trial and error, we can identify two additional routes. One is


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


PLANARITY AND EULER’S FORMULA
Planetary
A puzzle that was posed some time ago goes something like
this Three utility companies each need to run pipes to three
houses, Can they do so without crossing over each other's
pipes at any point? The puzzle is illustrated in figure 6.15
connecting each utility company to each house without letting
any pipes cross over each other

Figure 6.15

To solve the puzzle, we need to draw an equivalent graph in which


no edges cross over each other. If this is possible, the graph is
called a planar graph.
Planar Graph
A Planar graphs are graphs that can be drawn without any
overlapping edges.

• It may be necessary to redraw a graph so that you can


identify if it is planar or not.

• All simple graphs with 4 or fewer vertices are planar.

• Any complete graph with 5 or more vertices is non-planar.


Example:

If the graph is drawn in such a way that no edges cross,


we say that we have a planar drawing of the graph.
Question:

Is this a planar drawing of a graph? Is the graph planar?


Answer:

The drawing is not planar because two edges cross.


The graph is planar because we can make an
equivalent graph in which no edges cross over each
other.
Example 1: Identify a Planar Graph

Show that the graph below is planar


Solution
As given, the graph has several intersecting 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 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

C
A C A

E D E D
Check your progress 1
Show that the following graph is planar.
X Y Z

A B C
Figure 6.16
To see that the graph in figure 6.16 The Utilities Graph

representing the puzzle of connecting utilities is


not planar, note that the graph is Hamiltonian,
and one Hamiltonian circuit is A-X-B-Y C-Z-A.
If we redraw the graph so that this circuit is drawn in a loop
(figure 6.17), we then need to add the edges AY, BZ, and CX. All
three of these edges connect opposite vertices. We can draw
only one of these edges inside the loop; otherwise two edges
would cross.
X X
A B A B

Z Y Z Y
C C
Figure 6.17
Figure 6.18
Subgraph Theorem

If a graph G has a subgraph that is not planar, then G is also


not planar. In particular. if G contains the Utilities Graph or K,
as a subgraph, G is not planar.

Example 2: Identify a Nonplanar Graph


Solution
In the figure below, we have highlighted edges connecting
the top six vertices. If we consider the highlighted edges and
attached vertices as a subgraph, we can verify that the
subgraph is the Utilities Graph. (The graph is slightly
distorted compared with the version shown in Figure 6.16,
but it is equivalent.) By the preceding theorem, we know that
the graph is not planar.
Check your progress 2: Show that the following graph is planar.

We can expand this strategy by considering contractions of a


subgraph. A contraction of a graph is formed by "shrinking" an
edge until the two vertices it connects come together and
blend into one. If, in the process, the graph is left with any
multiple edges, we merge them into one. The process is
illustrated on the next slides.
Shrink the bottom Until it vanishes Combine the multiple
edge edges to one

Example 2: Contracting a Graph


Show that the first graph below can be
contracted to the second graph
Solution

Contract the edge


Until it vanishes
colored red

Combine the Straighten the


multiple edges curved edge
Check your progress 3:
Show that the first graph below can be contracted to the
second graph

If we consider contractions, it turns out that the Utilities Graph


and K, serve as building blocks for nonplanar graphs. In fact, it
was proved in 1930 that any nonplanar graph will always have
a subgraph that is the Utilities Graph or K, or a subgraph shat
can be contracted to the Utilities Graph or K We can then
expand our strategy, as given by the following theorem.
GRAPH COLORING
and
ITS CHROMATIC NUMBER
GRAPH COLORING

A coloring for a graph is a coloring of the vertices


in such a way that the vertices joined by an edge
have different colors.

Graph coloring also called as "Vertex coloring".

CHROMATIC NUMBER

• chromatic number of a graph is the least number of colors


needed to produce a proper coloring of a graph.
Example of graph coloring and
identifying the chromatic number.

In this graph,
•No two adjacent vertices are colored with the
same color.
•The chromatic number is 3.
Coloring Maps

Map coloring is the act of assigning different colors to


different features on a map. Coloring

COLORING A MAP
and
THE FOUR COLOR THEOREM
COLORING A MAP

• Map coloring is the act of assigning


different colors to different features on a
map.
FOUR COLOR THEOREM
• The four color theorem, or the four color map theorem, states
that no more than four colors are required to color the regions
of any map so that no two adjacent regions have the same
color.
HOW TO COLOR A MAP?

In my
presentation
i used Map of
Southern
Africa as an
example.
1)Assign a label
to each country.
The label will
serves as the
vertices.
2) Based on
the map of
Southern
Africa that we
labeled earlier.
We are going
to use the
edges to
connect the
vertices of
countries that
sharing
borders.
3) will use this
procedure to color
the graph.
•Label Degrees
•Always start
coloring with highest
degree vertex. you
can use the color
you want but make
sure you will not
color the same the
two connected
vertex.
TWO-COLORABLE GRAPH THEOREM
• we shall color the vertices of a graph, observing
two rules: every vertex must be colored, and two
vertices linked by an edge cannot be given the
same color
A SCHEDULING APPLICATIONS OF
GRAPH COLORING
Vertex coloring models to a number of
scheduling problems.
Details of the scheduling problem define the
structure of the graph.

EXAMPLE:
North Central is offering eight courses during its summer
session. The table shows with an X which pairs of courses have
one or more students in common. Only two air-conditioned
lecture halls are available for use at any one time.
To design an efficient way to schedule the final examinations,
represent the information in this table by using a graph. In the
graph represents courses by vertices and join two courses by an
edge if there is any student enrolled in both courses.
We will be making a vertex for each course
from the table.
Now, we need to put the edges.
NOW, LET'S COLOR THE GRAPH.

We see that our χ= 4


This means that 4 times needed.
Slot 1 - F, H Slot 3 - C,M,S
Slot 2 - P, I Slot 4 - E

You might also like