0% found this document useful (0 votes)
37 views40 pages

GRAPH THEORY Presentation July192k16

The document discusses graph theory, focusing on the shortest path problem and its applications in real-life scenarios such as travel planning and scheduling. It introduces key concepts such as connected graphs, Euler trails, Hamilton circuits, and Dijkstra's algorithm for finding the shortest path in weighted graphs. The presentation also includes historical context with the Königsberg problem and practical examples to illustrate graph concepts.

Uploaded by

klaizer35
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)
37 views40 pages

GRAPH THEORY Presentation July192k16

The document discusses graph theory, focusing on the shortest path problem and its applications in real-life scenarios such as travel planning and scheduling. It introduces key concepts such as connected graphs, Euler trails, Hamilton circuits, and Dijkstra's algorithm for finding the shortest path in weighted graphs. The presentation also includes historical context with the Königsberg problem and practical examples to illustrate graph concepts.

Uploaded by

klaizer35
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/ 40

GRAPH THEORY:

TRAVERSING THE
SHORTEST PATH
PROBLEM

PATRICIA FAYE V. MISULA


Southern Luzon State University
CAM Auditorium
19 July 2016
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 below. 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.


Königsberg Seven
Aufmann, Joanne S. Lockwood, Richard D. Nation, Daniel
K. Clegg Bridge
“Is it possible to take a walk through town, crossing each
of the seven bridges just once, and ending up wherever
you started?"
GRAPH THEORY
is the study of graphs, which are mathematical
structures used to model pairwise relations of objects.
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.
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.
a) 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.
b)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?
Grap ALA

h
KIA PF

A graph G=(V,E) BW BBE

consist of a nonempty set


of vertices and E, a set of
TNT BGSM

edges. Each edge has


either one or two vertices
associated with it, called NLEX MER

its endpoints. A edge is ROS

GPBP
SMB

said to connect its


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.
Simple Graphs and Multiple Graphs
Vertex
Degree
deg(v) is the number
of edges incident with
vertex v, counting each
loop as two edges.
Neighborhood of a
Vertex
NG(v), the set of all
vertices that are adjacent
to v.
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.
• A directed graph 𝐷 is a pair ( 𝑉, 𝐴)
Directed Graph (digraph)
consisting of a set 𝑉(𝐷) of vertices and
a set 𝐴(𝐷) of arcs that are formed
using ordered pairs of vertices in 𝑉( 𝐷).
• If 𝑢 and 𝑣 are vertices of 𝐷, then we
write the arc from 𝑢 to 𝑣 as [𝑢, 𝑣].
Out-degree of a vertex
Let 𝑣 be a vertex of a
digraph 𝐷. The
outdegree of 𝑣 denoted
by 𝑜𝑑(𝑣) is the number

adjacent from 𝑣.
of vertices that are
In-degree of a Vertex

The indegree of 𝑣
denoted by 𝑖𝑑(𝑣) is
the number of

adjacent to 𝑣.
vertices that are
Walk…Trail…Path…Cycle
A walk between vertices u and z of

and edges such that the vertices 𝑣0,𝑣1,


length n in G, is a sequence of vertices

…,𝑣𝑘−1,𝑣𝑘 and the edges are as follows:


𝑣0𝑣1,𝑣1𝑣2,…,𝑣𝑘−1𝑣𝑘
Walk…Trail…Path…Cycle
A trail is a walk in which all edges are
distinct.
A path is a walk in which all vertices are
distinct. In this case, all edges are also
distinct.
A cycle is a walk in which all vertices are
Example of
Walks
1. (c,b,a,c,d,e,c,a,b)

2. (e,c,a,b)

3. (c,a,b,c,d)

4. (c,a,b,c)
Euler Trails
• A trail which includes each edge of G is
called an Euler trail of G.
Theorem (Euler, 1736).
A connected graph G with edges is eulerian if
and only if G does not have a vertex of odd
degree.
Corollary. A connected graph G with edges
contains an Euler trail if and only if G has
Hamilton Circuit and Hamilton Path
• A Hamilton circuit in a graph is a simple circuit containing every vertex
of the graph.
• An Halmilton path is a simple path containing every vertex of the
graph.
A B

A B
C
E
G1 : D E
G2 :
D C
Subgraph and Spanning Subgraph
Let G and H be graphs.

𝑉(𝐻) ⊆ 𝑉(𝐺) and 𝐸(𝐻) ⊆ 𝐸(𝐺).


The graph H is a subgraph of G if

The graph 𝐻 is a spanning subgraph


of 𝐺 if
𝑉(𝐻) = 𝑉(𝐺) and 𝐸(𝐻) ⊆ 𝐸(𝐺).
Connected graph
A graph G is said to be connected if or
every pair of vertices u and v in the
graph, there is a path from u to v.
Otherwise, G is disconnected.
Tree
A connected graph which does not
contain a cycle is a tree.
Weighted graph
A graph 𝐺 is a weighted
a
9 b
graph if all the edges of 𝐺
2
14
9
e
11
6
are assigned with
s 10
c
numerical values.
7 15
f
The Shortest Path Problem
The problem is to find in a weighted
graph, a path of minimum weight
connecting two specified vertices, say
u and z.
Assumptions:
graph is simple and connected, and
all the weights are positive.
Dijkstra’s Algorithm
1. Label the initial vertex s
2. Box this number (permanent label)
3. Label each vertex that is connected to the
initial vertex with its distance (temporary
label)
4. Box the smallest number
5. From this vertex, consider the distance to
each connected vertex.
Dijkstra’s Algorithm
6. If a distance is less than a distance
already at this vertex, cross out this vertex,
and write in the new distance. If there was
no distance at the new vertex, write down
the new distance.
7. Repeat from step 4 until the destination
vertex is boxed.
Find the shortest path from vertex 𝑠 to all
other vertices of the given graph.
2
a b

3 8
4
1
s 6 7 c

4 4

e f
5
Find the shortest distance from the leftmost vertext to the
rightmost vertex in the network below.

w 5 x

5 4
3 1

v z y
9 6
Try this one!!
Which vertex A, H, and G is nearest to vertex
D??
Steps in Dijkstra’s Algorithm
1.Initialization
2.Distance value update
3.Current vertex update
4.Termination criterion
Some real life applications of Shortest Path Algorithm
Study Author
Use of Shortest Path Renalyn C. Edlagan (2012)
Algorithm in the Laguna
Fourth District Tourist
Destinations
Escaping The Danger Zone: Arjay Altovar (2016)
Proposed Earthquake
Evacuation Route For
Selected Southern Luzon
State University Buildings
"Education's purpose is to replace an empty
mind with an open one."
-Malcolm Forbes

ThAnK yOu foR LisTeNinG. 

You might also like