0% found this document useful (0 votes)
558 views38 pages

Graphs

This document discusses various graph theory concepts including graphs, trees, coloring, Euler paths and circuits, and Hamiltonian paths and circuits. It provides definitions, examples, theorems, and applications related to finding shortest routes, coloring maps and networks, and analyzing social and transportation networks. Key concepts covered include vertices, edges, paths, circuits, degrees, planar graphs, chromatic numbers, 2-colorable graphs, and the four color theorem.
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)
558 views38 pages

Graphs

This document discusses various graph theory concepts including graphs, trees, coloring, Euler paths and circuits, and Hamiltonian paths and circuits. It provides definitions, examples, theorems, and applications related to finding shortest routes, coloring maps and networks, and analyzing social and transportation networks. Key concepts covered include vertices, edges, paths, circuits, degrees, planar graphs, chromatic numbers, 2-colorable graphs, and the four color theorem.
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/ 38

CHAPTER 5

THE MATHEMATICS OF
GRAPH
APPLICATION OF GRAPH
THEORY IN REAL LIFE
GPS or Google Maps GPS or Google Maps are to find a
shortest route from one destination to another. The
destinations are Vertices and their connections are Edges
consisting distance.
Traffic lights The functioning of traffic lights i.e. turning
Green/Red and timing between them. Here vertex coloring
technique is utilized to solve conflicts of time and space by
identifying the chromatic number for the number of cycles
needed.
Social Networks We connect with friends via social media or
a video gets viral, here user is a Vertex and other connected
users create an edge therefore videos get viral when reached
to certain connections.
To clear road blockage When roads of a city are blocked due
to ice. Planning is needed to put salt on the roads. Then Euler
paths or circuits are used to traverse the streets in the most
efficient way.
Leonhard Euler- A swiss mathematician,
solve an eighteenth century problem
involving the seven bridges of Konisbergin
Old Prussia.
GRAPH
A graph is a collection of points called vertices or nodes and line
segments or curves called edges that connect the vertices.
DEFENITIONS
Loop- Is an edge connecting a vertex to itself .

Multiple Edges- If two vertices are connected by more than one edge.

Simple graph- A graph with no loops and no multiple edges.

Path- Is an alternating sequence of vertices and edges. It can been as


a trip from one vertex to another using the edges of the graph.

A graph is Connected if there is a path connecting all the vertices.

If a Path begins and ends with the same vertex , it is a closed path or
a circuit or a cycle.
Two vertices are adjacent if there is an edge joining them.
If very pair of vertices of a graph are adjacent, the graph is complete.
A complete graph with n vertices is denoted by Kn.
The degree of vertex is the number of edges attached to it.
EXAMPLES
OF GRAPH
NULL OR DISCONNECTED GRAPH
The graph below is a null or disconnected graph since it has three
vertices but no edges. The degree of each vertex is 0.
GRAPH WITH LOOP
The loop connects vertex A to itself. The degree of a loop is 2.
GRAPH WITH MULTIPLE EDGES
Both graphs G1 and G2 below are connected and have multiple edges
connecting vertices A and B. The degrees of vertices A and B in G1 are
both equal to 3 while that of G2 are both equal to 4.
COMPLETE GRAPH
A complete graph is a connected graph in which every possible edge is
drawn between vertices. It should not contain multiple edges.
EULER PATHS
AND
CIRCUITS
EULER CIRCUITS
An Euler circuit is a close path that uses every edge, but never uses the
same edge twice. The path may cross through vertices more than once.
EULERIAN GRAPH THEOREM
A connected graph is eulerian if and only if every vertex of the graph is
of even degree.

Example: Determine wether the graph is Eulerian. If it is, find an


Eulerian circuit. If its not explain why?
EULER PATH
An Euler Path is a path that uses every edge in the graph exactly once
but it does not start and end at the same vertex.
If and only if there are at most two vertices with odd degree.
EULER PATH THEOREM
A connected graph contains an Euler Path if and only if the graph has
two vertices of odd degrees with all ther vertices of even degrees.
Furrthermore , every Euler path must start at one of the vertices of
odd degrees and end at the other.
EULER PATH THEOREM
HAMILTON
PATHS AND
CIRCUITS
SIR WILLIAM ROMAN
HAMILTON
HAMILTON PATH
A Hamiltonian path is a path that visits
each vertex of the graph exactly once.
HAMILTON CIRCUIT
A Hamiltonian Circuit is a path that uses each vertex of a graph
exactly once and returns to the starting vertex. A grapg that contains
Hamiltonian circuit is called Hamiltonian.
Dirac’s Theorem
Consider a connected graph with at least 3 verticles and no multiple
edges. Let n be the number of verticles in the graph. If every vertex has
degree of at least n/2, then the graph must be Hamiltonian.
Determine Whether the graph
is Hamiltonian or not. If it is,
find a Hamiltonian circuit. If it
is not, explain why.
Solution:
There are seven vertices, hence
n/2=3.5. Since vertex A is of degree
2, less than 3.5, Dirac’s Theoem does
not apply here. But it does not
necessarily follow that the graph is
not Hamiltonian. In fact, it is.
Consider the path A – B – C – E – D – F
– G – A. This path visits each vertex
only once in the graph and returns to
its starting point, therefore it is
Hamiltonian.
AN APPLICATION OF
HAMILTON CIRCUIT
The graph shows the available flights of
a popular airline

Weighted Graphs
A weighted graph is a graph in which each edge is associated with a value, called
weight.
Solution:
There Are ten verticles in the graph, so
n=10 and n/2=5. Now, vertex Manila has
9 edges, Tokyo 5, Seoul 5, Taipei 6,
Hongkong 7, Macau 9, Bangkok 6, Ho Chi
Minh 5, Kuala lumpur 5, and Singapore 5.
Using Dirac’s Theorem, if each vertex has
a degree of at last n/2=5, then the graph
is Hamiltonian. This means that the
graph contains a circuit that visits each
vertex and returns to its starting point
without visiting a vertex more than once.
AN APPLICATION OF
HAMILTON CIRCUIT
The table below list down the distances
(miles) between the cities having direct
routes as well as the corresponding
distances between them.
Manila Cebu Cagayan de Davao Palawan Ozamis
Oro

Manila - 355 485 589 358 477


Cebu 355 - 137 240 354 148
Cagayan de 485 137 - 118 414 64
Oro

Davao 589 240 118 - 495 133


Palawan 358 354 414 495 - 363
Ozamis 477 148 64 133 363 -
SOLUTION
a. The graph along with the weights of the edges is
shown below.

.B. One Hamiltonian circuit is Ozamis – Cagayan de Oro – Cebu – Palawan –


Manila – Davao then back to Ozamis. The total distance travelled is
64+137+354+358+589+133= 1635 miles. Another node route is Ozamis – Davao
– Cagyan de Oro – Palawan – Cebu – Manila – then back to Ozamis. This circuit
has a total distance of 133+118+414+354+355+477= 1851 miles. Obviously, the
first node route is shorter than the second.
SOLUTION
The Greedy Algorithm
1. Choose a vertex to start at, and then travel along the
connected edge that has the smallest weight. (if two
or more edges have the same weight, pick any one.)
2. After arriving at the next vertex, travael along an
edge of the samallest weight that connects to a
vertex not yet visited. Continue this process until you
have visited all vertices.
3. Return to the starting vertex.
Aaron, Belle, Carol, Donna, Eric and Fe are
best of friends. The figure shows the
distances (in Kilometers) from afriends
place to another. If Aaron wants to visit
each of his friend’s houses exactly once,
what is the shortest route that he must
take?
The Edge Picking Algorithm
1. Mark the edge of the smallest weight in the graph.(if two or more
edges have the same weight, pick any one.)
2. Mark thgthe edge of the next smallest weight in the graph, as long as it
does not complete a circuit and does not add a third mark edge to a
single vertex.
3. Continue this process until you can no longer mark any edges. Then
mark the final edge that completes the Hamiltonian circuit.
Solution using the Edge-Picking Algorithm
First, Mark the line segment from Aaron’s
house to Belle’s house, of weight 1.
Next, mark the
In 1852 he first formulated the four colour conjecture, which taxed
the minds of mathematicians until it was eventually proved in 1976.
It states that the minimum number of colours needed to fill in any
map, real or invented, so that neighbouring countries are always
coloured differently, is four.
GRAPH COLORING
Graph coloring is nothing but a simple way of
labelling graph components such as vertices,
edges, and regions under some constraints. In a
graph, no two adjacent vertices, adjacent edges, or
adjacent regions are colored with minimum
number of colors. This number is called the
chromatic number and the graph is called a
properly colored graph.
CHROMATIC NUMBER OF A
GRAPH
The chromatic number of a graph G is the smallest
number of colors needed to color the vertices of G
so that no two adjacent vertices share the same
color (Skiena 1990, p. 210), i.e., the smallest value
of k possible to obtain a k-coloring. Minimal
colorings and chromatic numbers for a sample of
graphs are illustrated above.
2-COLORABLE GRAPH THEOREM
A GRAPH IS 2-COLORABLE IF AND ONLY IF IT HAS NO
CIRCUITS THAT CONSIST F AN ODD NUMBER OF
VERTICES

FOUR-COLOUR THEOREM
THE CHROMATIC NUMBER OF A PLANAR GRAPH IS AT
MOST 4
TREES
A TREE IS A MATHEMATICAL STRUCTUREWHICH IS A
TYPE OF GRAPH WHICH HAS THE FOLLOWING
PROPERTIES:

(1) UNDIRECTED

(2) CONNECTED (EACH OF THE VERTICES IS CONNECTED


OR LINKED TO ATLEAST ONE OTHER VERTEX

(3) ACYCLIC (THERE IS ONLY ONE ROUTE FROM ANY


VERTEX TO ANY OTHER VERTEX OR HAS NO CYCLE)
FULL M-ARY TREES
IT IS A TREE IN WHICH ALL EXTERNAL VERTICES ARE AT
THE SAME DEPTH OR HAS EXACTLY m CHILDREN. TREE
T1, IN THE FOLLOWING FIGURE HAS EXACTLY TWO
CHILDREN PER VERTEX AND HENCE IS CALLED A FULL
BINARY TREE.

HEIGHT
THE HEIGHT OF A ROOTED TREE IS THE NUMBER ODGES
ALONG THE LONGEST PATH FROM THE ROOT VERTEX TO
THE FARTHEST CHILD VERTEX
NYEM!

You might also like