0% found this document useful (0 votes)
17 views22 pages

Lesc3 GraphTheory

Uploaded by

gabreyl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views22 pages

Lesc3 GraphTheory

Uploaded by

gabreyl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 22

Graph Theory

Seven Bridges of Königsberg

 Notable historical problem in the field of


mathematics
 Foundation of graph theory and prefigured
the idea of topology (geometry and set
theory)
 Leonhard Euler (pronounced as Oiler)
Problem

 Isit possible
to have a
walk in the
city of
Königsberg,
that crosses
each of the
seven bridges
only once?
In order to approach the problem, Euler
represented the important information as a
graph:
Some applications of Graph Theory
 Models for communications and electrical
networks
 Models for computer architectures
 Network optimization models for operations
analysis, including scheduling and job
assignment
 Analysis of Finite State Machines
 Parsing and code optimization in compilers
 Car navigation system
 Efficient database
 Build a bot to retrieve info off
WWW
 PERT Chart in SysDes/SoftEng
 What are graphs good for? Graphs are perhaps the most
pervasive abstraction in computer science. It is hard to
appreciate their tremendous usefulness at first, because
the concept itself is so elementary.

 This appreciation comes through uncovering the deep and


fascinating theory of graphs and its applications.
 Graphs are used to model and study transportation
networks, such as the network of highways, the London
Underground, the worldwide airline network, or the
 European railway network; the ‘connectivity’ properties
of such networks are of great interest.
 Graphs can also be used to model the World Wide Web,
with edges corresponding to hyperlinks; Google uses
sophisticated ideas from graph theory to assign a
PageRank to every vertex of this graph as a function of
the graph’s global properties.
Definition of Graph

A graph (sometimes called: Network) consists of two


entities:
Vertices
 Vertex V (or: node)
 Edge E (or: link)
 Edge: Undirected link
 Arc: Directed link Edges

11
A graph is a bunch of vertices (or nodes)
represented by circles which are connected by
edges, represented by line segments
 The graph is denoted as :
G = (V,E)
Properties of Vertex and Edge
 An edge can either be a
 Boolean property (connection vs. no
connection), or
 encoded as a strength (distance, traveling
time, etc.)
A vertex can also contain information.
Kinds of Graph
Undirected Graph (Graph)
 Consists of a set V of vertices and set E of edges such that an
edge e  E is represented as an unordered pair of vertices where
e=(v,w) or e=(w,v)
* Modeling one way streets, hyperlinks in WWW
 Directed Graph (Diagraph)
 Consists of a set V of vertices and set E of edges such that an
edge e  E is represented as an ordered pair of vertices where
e=(v,w)
Undirected Graph

V = { 1, 2, 3, 4} |V|=4
E = {(1,2), (2,3), (2,4), (4,1)} | E |=4
Degree of a Vertex
Degree of a vertex in an undirected graph is
the number of edges incident on it.
In a directed graph, the out degree of a
vertex is the number of edges leaving it and
the in degree is the number of edges
entering it.
2
2

1 3
3
1

4
4

The degree of
vertex 2 is 3
The in degree of
vertex 2 is 2 and the in
degree of vertex 4 is 1
2
2

1 3
3
1

4
4

The degree of
vertex 2 is 3
The in degree of
vertex 2 is 2 and the in
degree of vertex 4 is 1
Directed Graph
An edge e  E of a directed graph is represented as an
ordered pair (v,w), where v, w  V.
2

3
1

V = { 1, 2, 3, 4}, |V|=4
E = {(1,2), (2,3), (2,4), (4,1), (4,2)}, | E |=5
 Cliques. A graph on n vertices where every pair of
vertices is connected is called a clique (or n-clique) and is
denoted by Kn.

 Size. The number of edges of a graph is called size.


Walks and Paths
V2 3
V3
1
2
3
V1 1
V6
4
4

V4 1 V5

A walk is a sequence of vertices (v1, v2,..., vL) such that


{(v1, v2), (v1, v2),..., (v1, v2)}
A simple path is a walk with no repeated nodes,
e.g. (V1, V4,V5, V2,V3)
A cycle is n walk (v1, v2,..., vL) where v1=vL
with no other nodes repeated and L>3, e.g.
(V1, V2,V5, V4,V1)

A graph is called cyclic if it contains a cycle;


otherwise it is called acyclic

You might also like