Directed Graph: Dr. Safaa O. Al-Mamory
Directed Graph: Dr. Safaa O. Al-Mamory
Directed Graph: Dr. Safaa O. Al-Mamory
Department of Software 2
PlanarGraph
A graph or multigraph which can be drawn in the plane so
that its edges do not cross is said to be planar.
Department of Software 3
Maps & Regions
A particular planar representation of a finite planar
multigraph is called a map. We say that the map is
connected if the underlying multigraph is connected.
A given map divides the plane into various regions.
By the degree of a region r, written deg(r), we mean the
length of the cycle or closed walk which borders r.
Department of Software 5
Dual Maps & The Four Color Theorem
Any planar graph is 4-colorable
Department of Software 6
Welch-Powell Coloring Algorithm
.
Department of Software 7
Welch-Powell Coloring Algorithm
A5,A1
A3,A4,A8
A7,A2,A6
So, it is 3-colorable.
Department of Software 8
DiGraph
A directed graph,or digraph,consists of:
a set V ,whose elements are called vertices,
a set E,whose elements are called directed edges or
arcs,and an incidence function that assigns to each edge a
tail and a head. The tail of an arc is the vertex it
leaves,and the head is the vertex it enters. E
A strict digraph has no
D
self-loops or multi-arcs.
C
Department of Software A 9
In Degree & Out Degree
If <v0, v1> is an edge in a directed graph
v0 is adjacent to v1, and v1 is adjacent from v0
The edge <v0, v1> is incident on v0 and v1
The in-degree of a vertex v is the number of edges
that have v as the head
The out-degree of a vertex v is the number of edges
that have v as the tail
The degree of v, or deg(u), is the sum of its indegree and
outdegree. A vertex with indegree 0 is a source and with
outdegree 0 a sink.
Department of Software 10
In Degree & Out Degree (Cont.)
If di is the degree of a vertex i in a graph G with n vertices
and e edges, the number of edges is
n 1
e( d )/ 2
0
i
Department of Software 12
Reachability
Aclosed path is a cycle. If a directed path runs from vq to vn,
vn is reachable from vq.
Is there some way to determine if a vertex Vj in a digraph is
reachable from a vertex u?
Department of Software 13
Strongly Connected Graph
A digraph D is strongly connected if every vertex in D is
reachable from every other vertex.
Theorem
Department of Software 14
Example
Is the digraph D strongly connected?
Department of Software 16
Weighted Adjacency Matrix
.
Department of Software 17
Shortest Path
A path of least weight from vertex u to vertex v in a
weighted digraph is a shortest path from u to v.
An efficient method was developed in 1959 by the Dutch
mathematician Edsger W. Dijkstra, a pioneer in the art of
computer programming.
Dijkstra‘s algorithm can find a shortest path from any
vertex to any vertex in the digraph, if it exists, as the next
example demonstrates.
Department of Software 18
Dijkstra’s Algorithm
Example 1
Department of Software 19
Dijkstra’s Algorithm (Cont.)
Example 2
Department of Software 20
Dijkstra’s Algorithm (Cont.)
A
Department of Software 21
Be ready for the
exam on the next
lecture
Department of Software 22
References
1. Seymour Lipschutz, and Marc Lipson, “Schaum’s
Outlines: Discrete Mathematics,” 3rd edition, McGraw-
Hill, 2007.
2. Rosen, Discrete Mathematics and Its Applications, 6th
edition, 2007.
3. Kevin Ferland, Discrete Mathematics, An Introduction
To Proofs And Combinatorics, Richard Stratton, 2009.
4. Thomas Koshy, Discrete Mathematics with Applications,
Elsevier Press, 2004.
Department of Software 23
Thank You for
Listening.
Department of Software 24