0% found this document useful (0 votes)
29 views

Graph Theory

Uploaded by

Kaius Vezir
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Graph Theory

Uploaded by

Kaius Vezir
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

GRAPH THEORY

The Mathematics of Graphs


The mathematics of graphs can be used 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.
Mathematical Excursions, Third Edition Richard N. Aufmann,
Joanne S. Lockwood, Richard D. Nation, Daniel K. Clegg
Königsberg Problem

In the early eighteenth century, a river in a city called Königsberg


which was located in modern-day Russia had seven bridges
crossed the river connecting four different areas, similar to the map
drawn on the next slide. People at the time would attempt to take a
stroll that would lead them across each bridge and return them to
the starting point without passing the same bridge twice.

Mathematical Excursions, Third Edition Richard N.


Aufmann, Joanne S. Lockwood, Richard D. Nation, Daniel
K. Clegg
This is Konigsberg, now known
as Kaliningrad, in Russia. In the “Is it possible to take a walk
early 1700’s, people from this through town, crossing each of
town posed a particular question. the seven bridges just once, and
ending up wherever you started?"
The famous Swiss mathematician Leonhard
Euler (1707-1783) heard of the problem,
solved it and in the process invented Graph
Theory proved that it is, in fact, impossible to
walk such a path.
The study of graphs is known as Graph Theory.
Introduction to Graphs
• A graph is a set of points called vertices and line segments or curves called
edges that connect vertices.

The graph represents the flights available on a particular airline between a


selection of cities; each vertex represents a city, and an edge connecting
two cities means that there is a direct flight between the two cities.
Graphs are structures consisting of vertices and edges that
connect the vertices. We let V(G) as the set of vertices and
E(G) as the set of edges.

Two vertices are said to be adjacent or neighbors if there is


an edge connecting them. Equivalently, it can also be said that
the edge is incident with those vertices.

Suppose V(G) = {A, B, C, D, E, F} and E(G) = {AB, AF, BC, BF,


CD, CE, CF, DE, EF}. Then, what is the pictorial representation
of graph G ?
Example
The following table lists five students at a college. An “X”
indicates that the two students participate in the same study
group this semester.
1. 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.

2. Use your graph to answer the


following questions:
✓ Which student is involved in the most
study groups with the others?
✓ Which student has only one study
group in common with the others?
Connected Graphs
Connected graphs are graphs in which any vertex can be
reached from any other vertex by tracing along edges.

This is a connected graph in which every possible edge is


drawn between vertices (without any multiple edges). Such a
graph is called a complete graph.
This is a connected graph that has a pair of multiple edges.
• This graph has five vertices but no edges and is
referred to as a null graph. It is also an example of a
disconnected graph.
• This graph is not connected. It consists of two
different sections. It also contains a loop.
Question
• Is the following graph a complete graph?
Equivalent Graphs
• Graphs are said to be equivalent graphs if the edges
form the same connections of vertices.
• The following are equivalent graphs.
Example
• Determine whether the following two graphs are equivalent.

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 graphs represent the
same connections among the vertices, they are equivalent.
Simple Graphs and Multiple Graphs
An edge joining distinct vertices is called a link and
a b

an edge joining identical vertices is called a loop


e Two or more edges joining the same pair of vertices
are called multiple edges
d c
A graph without loop nor multiple edges is said
g to be simple.
A graph with one vertex is said to be trivial.
f h
k
The order of 𝐺, denoted by |𝑉|, is the number of
vertices in 𝐺.
j
The size of 𝐺, denoted by |𝐸|, is the number of edges
in 𝐺.
Vertex Degree

deg(v) is the number of a b

edges incident with vertex


v, counting each loop as e

two edges.
d c
On this graph the vertices a,
b, c and d have a degree of 2,
while vertex e has a degree of A loop at a vertex contributes
twice to the degree of the
four. vertex.
Handshaking Lemma
(First Theorem of Graph Theory)
In any graph, the sum of all the vertex
degrees is equal to twice the number of edges.
Recitation:
Find the degree of each vertex.
Find the number of edges.
Prove that the Handshaking Lemma is true to this graph.
Euler Graph
Any connected graph is called an Euler Graph if and only if all its vertices
are of even degree.
An Euler Graph is a connected graph that contains an Euler Circuit.

This graph is a connected graph and all its vertices are of even
degree.
Therefore, it is an Euler graph.
Euler Path
Euler path is also known as Euler Trail or Euler Walk.
•If there exists a Trail in the connected graph that contains all
the edges of the graph, then that trail is called as an Euler trail.

•If there exists a walk in the connected graph that visits every
edge of the graph exactly once with or without repeating the
vertices, then such a walk is called as an Euler walk.

A graph will contain an Euler path if and only if it contains at


most two vertices of odd degree.
Euler Path Examples
Euler Circuit
• If there exists a Circuit in the connected graph that contains all the
edges of the graph, then that circuit is called as an Euler circuit.
• If there exists a walk in the connected graph that starts and ends at the
same vertex and visits every edge of the graph exactly once with or
without repeating the vertices, then such a walk is called as an Euler
circuit.
• An Euler trail that starts and ends at the same vertex is called as an
Euler circuit.
• A closed Euler trail is called as an Euler circuit.
A graph will contain an Euler circuit if and only if all its vertices are of
even degree.
Euler Circuit
Examples
Hamiltonian Cycle
• A Hamiltonian cycle is a closed loop
on a graph where every node (vertex)
is visited exactly once.
• A loop is just an edge that joins a
node to itself; so a Hamiltonian cycle
is a path traveling from a point back to
itself, visiting every node en route.
• If a graph with more than one node
(i.e. a non-singleton graph) has this
type of cycle, we call it a Hamiltonian A dodecahedron ( a regular solid
graph. figure with twelve equal pentagonal
faces) has a Hamiltonian cycle.
Hamiltonian Paths and Hamiltonian Circuits
A Hamilton Path is a path that goes through every Vertex of a graph exactly once. A
Hamilton Circuit is a Hamilton Path that begins and ends at the same vertex.

Notice that not all edges need to be used. Unlike Euler Paths and Circuits, there is
no trick to tell if a graph has a Hamilton Path or Circuit.
Hamiltonian Path
A delivery driver wants to make the best
use of her time and vehicle's gas
mileage by planning a route that will
require the least amount of mileage and
time. In Figure 1, the houses she plans
to make deliveries to are numbered
from two to six, with the delivery
warehouse marked as one. To reduce
the amount of time she spends driving When following this path in Figure 1, it
and delivering, the driver plans her becomes clear that each of these stops is
traveled to only once by the driver. Because
route with the stops in the following only one visit is made to each of these stops,
order: 1, 2, 6, 3, 4, 5. the path chosen by the driver represents
a Hamiltonian path.
Hamiltonian Circuit
In Figure 2, the same neighborhood is
depicted in the form of a pentagon with
houses labeled from two to six, with node 1
representing the warehouse. This time, the
delivery driver wants to plan the most
efficient route in order to make her deliveries
and return to the warehouse afterward.
Because the driver will be starting and ending
her route at the first node (or first vertex), her
path represents a Hamiltonian circuit. In this
case, her route will travel along the following
path: 1, 2, 6, 3, 4, 5, 1.
Example 1- Does the
following graph have
a Hamiltonian Circuit?
Solution- Yes, the
above graph has a
Hamiltonian circuit.
The solution is –
Example 2- Does
the following graph
have a Hamiltonian
Circuit?
Solution- No, the given
graph does not have a
Hamiltonian circuit as
there are two vertices
with degree one in the
graph.
Study the graph and
answer the following.
1. Is the graph an
Eulerian graph? Why?
2. Is the graph
Hamiltonian? Why?
3. Identify:
a. Eulerian path
b. Eulerian circuit
c. Hamiltonian path
d. Hamiltonian circuit
"Education's purpose is to replace an empty mind
with an open one."
-Malcolm Forbes

ThAnK yOu foR LisTeNinG. ☺

You might also like