Graph
Graph
Problem
o Dispersion problems
– Identify franchise locations such that no two locations are close
enough to compete with each other
o More generally
– Any problem where you have multiple objects, there are conflicts
between pairs of objects, and you have to select a group of
objects with no conflicts between them
GRAPH THEORY
What is an Independent Set?
o Given a graph G = (V,E), an independent set Vis of G is a subset of V
such that G has no edge between any pair of vertices in Vis
o Example:
Graph G Clique of G
GRAPH THEORY
cDNA Microarrays (data representation and clustering)
o Takes “snapshot” of cellular mRNA levels under chosen
experimental conditions
Faculty Course
Definition
A graph G=(V,E) consists of a set of objects V,
called the “vertices” and a set E of “edges” which
are unordered pairs of distinct vertices.
V {v1 , v2 , , vn }
E vi , v j | vi , v j V , vi v j
Definition
1 e2
G e4
e1 4
3
2 e3
we say “3
“e4and
“4 isjoins
joined
incident
4 3are
and
toneighbours”
adjacent”
with
4”
4” e4”
GRAPH THEORY
Graph Drawing
We can draw a graph G in any way that illustrates the
adjacency information
1 e4
4
2 1e e
1 4 e24
3
2
e1 e 4
1 e
3
1 e e 4
3
2 2 e3 3
2
3
GRAPH THEORY
Graph Drawing
Polyline drawing
(corners=edje consist on more Planar straight line drawing
thn 2 lines, (no corner,no lines cutting)
lines cutting, )
G=(V,E)
isolated vertex
multiple
edges
adjacent
simple graph: an undirected graph without loop or multiple edges
degree of a vertex: number of edges connected
(indegree, outdegree)
For simple graphs, deg(v i ) 2 | E |
vi V
GRAPH THEORY
11.1 Definitions and Examples
a
x y
path: no vertex can be repeated e
b
a-b-c-d-e
trail: no edge can be repeat
a-b-c-d-e-b-d
d
walk: no restriction
a-b-d-a-b-c c
length: number of edges in
closed if x=y this (path,trail,walk)
closed trail: circuit (a-b-c-d-b-e-d-a,
one draw without lifting pen)
closed path: cycle (a-b-c-d-a)
GRAPH THEORY
11.1 Definitions and Examples
Theorem 1.1 Let G = (V , E ) be an undirected graph, with
a , b V , a b . If there exists a trail from a to b , then there is
a path from a to b . remove any cycle on the repeated
vertices
a x b
d d
c c
GRAPH THEORY
11.1 Definitions and Examples
Def. 11.5 For any graph G = (V , E ), the number of components
of G is denoted by ( G ).
1 ( G ) | V |
Def. 11.6
multigraph of multiplicity 3
multigraphs
GRAPH THEORY
11.2 Subgraphs, Complements, and Graph Isomorphism
Def. 11.7 If G = (V , E ) is a graph, then G1 (V1 , E1 ) is called
a subgraph of G if V1 V and E1 E , where each edge of
in E1 is incident with vertices in V1 .
a a
a b e
e e
b b
d d
c c
d d induced subgraph
c c include all edges
spanning subgraph of E in V1
V1=V
GRAPH THEORY
11.2 Subgraphs, Complements, and Graph Isomorphism
a
Def. 11.11 complete graph: Kn
e
b
K5
Def. 11.12 complement of a graph
a G G a d
c
e e
b b
d d
c c
GRAPH THEORY
11.2 Subgraphs, Complements, and Graph Isomorphism
Graph Isomorphism
2 a b
1
c
w x y z
3 4 d
Def. 11.13 Let G1 (V1 , E1 ) and G 2 (V 2 , E 2 ) be two
undirected graphs. A function f : V1 V 2 is called a graph
isomorphism if (a) f is one - to - one and onto and (b) for
all a , b V1 , ( a , b ) E1 if and only if ( f ( a ), f ( b )) E 2 .
When such a function exists, G1 and G 2 are called
isomorphic graohs.
GRAPH THEORY
11.4 Planar Graphs
R3 v=4,e=6,r=4, v-e+r=2
number number
number
of vertices of regions
of edges
GRAPH THEORY
DIFFERENT GRAPHS (2)
Let r >= 2 be an integer.
• Node deletion.
NP-Complete problems
• Edge deletion.
GRAPH THEORY
DIRECTED GRAPHS
o In a directed graph the set E of edges consists of ordered
pairs.
– For example: G = <V,E> such that
– V = {D,L,GY,SU};
– E = {<D,L>, <D,SU>,<L,SU>,<GY,D>}
F
GRAPH THEORY
SPANNING TREE
V2 V3 V2 V3
V6
V1
V1
V6
V4 V5 V4
GRAPH THEORY
MINIMUM SPANNING TREE
Given connected graph G with real-valued edge weights c e, a
Minimum Spanning Tree (MST) is a spanning tree of G whose sum
of edge weights is minimized
2 24 3 2 3
4 4
1 1
23 9 9
6 18 6
6 6
5 4 5 4
16 11 11
8 5 8 5
7 7
10 14
7 21 8 7 8