0% found this document useful (0 votes)
15 views29 pages

Graph

The document discusses various concepts in graph theory, including independent sets, cliques, and matching problems. It also covers applications in cDNA microarrays for gene clustering and the definitions of different types of graphs, such as bipartite and directed graphs. Additionally, it addresses properties of trees and spanning trees, including minimum spanning trees and Cayley's theorem.

Uploaded by

kashafbutt72
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)
15 views29 pages

Graph

The document discusses various concepts in graph theory, including independent sets, cliques, and matching problems. It also covers applications in cDNA microarrays for gene clustering and the definitions of different types of graphs, such as bipartite and directed graphs. Additionally, it addresses properties of trees and spanning trees, including minimum spanning trees and Cayley's theorem.

Uploaded by

kashafbutt72
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/ 29

GRAPH THEORY

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 Independent Set of G

Dispersion problem is an Independent Set (IS) problem


GRAPH THEORY
Independent Set Problem

o No known polynomial time algorithm(seprate the i.set)

o Verifying whether a set is independent can be done in


polynomial time
GRAPH THEORY
Related Problems – Clique
o Given a graph G = (V,E), a clique Vcl of G is a subset of V
such that for any two vertices u,v in Vcl then the edge (u,v) is
an element of E
o Any independent set of G is a clique of the complement of G

Graph G Clique of G
GRAPH THEORY
cDNA Microarrays (data representation and clustering)
o Takes “snapshot” of cellular mRNA levels under chosen
experimental conditions

o Two current representations:


– General un-weighted graph (enumerate maximal cliques, neighborhood
search, dominating set)
– Bipartite graph (biclique)

o Goal: Group genes that exhibit similar responses to stimuli –


co-regulation
GRAPH THEORY
Microarrays and General Graphs
Normalized Data Correlation Adjacency Matrix
Exp. A Exp. B Exp. C Gene 1 Gene 2 Gene 3
Calc. Correlation Coefficient
Gene 1 6 1 2 Gene 1 0.3 0.9
Gene 2 0 8 3 Gene 2 0.3 -0.75
Gene 3 9 1 4 Gene 3 0.9 -0.75
Correlation coefficient range: -1 to 1
1: Perfectly correlated
0: No correlation
Take Abs. Value, then -1: Perfectly anti-correlated
Threshold Filter (ex. 0.7)

Un-weighted Adjacency Matrix 1


Gene 1 Gene 2 Gene 3
Gene 1 0 1
Gene 2 0 1
Gene 3 1 1
3 2
GRAPH THEORY
o A set of courses, a set of faculty and a “can teach course” relationship between
elements of different sets.
o Find a matching that keeps the greatest possible number of faculty and
courses “active”.

o This is called a maximum matching (as opposed to a maximal matching which


cannot become any larger but is not the best possible)

Faculty Course

a maximum matching (in red) a maximal matching (in red)


GRAPH THEORY

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 

(the two vertices in an edge should be distinct)

We can denote the vertex set of a graph G by V(G),


and the edge set E(G).
GRAPH THEORY
e.g. V {1,2,3,4}
E 1,3, 2,3, 1,2, 3,4,
(remember that edges are UNORDERED pairs of vertices; e.g.1,3 3,1 )

We can represent a graph G=(V,E) with a drawing:


1 e2 1,3
G 4
e1 1,2 3
e4 3,4
2 e3 2,3
GRAPH THEORY

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, )

Orthogonal drawing Planar Orthogonal straight line drawing


(90 angel and corners ) (90 degre but not corners)
GRAPH THEORY
11.1 Definitions and Examples
Undirected graph Directed graph
loop

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

Def 11.4 Let G=(V,E) be an undirected graph. We call G connected


if there is a path between any two distinct vertices of G.
a e a e
b b
disconnected with
two components

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 |

Can you think of an algorithm to determine  ( G )?

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

A planar graph divides the plane


R1 into several regions (faces), one
K4 R2 R4
of them is the infinite region.

R3 v=4,e=6,r=4, v-e+r=2

Theorem 11.6 (Euler's planar graph theorem)


For a connected planar graph or multigraph:
v-e+r=2

number number
number
of vertices of regions
of edges
GRAPH THEORY
DIFFERENT GRAPHS (2)
Let r >= 2 be an integer.

A graph G = (V, E) is called r-partitie if V admits a partition into


r classes such that every edge has its ends in different
classes: vertices in the same partition class must not be
adjacent.

“2-partitie” graph is usually called a bipartite graph.

Two 3-partite graphs


GRAPH THEORY
DIFFERENT GRAPHS (2)
Clearly a bipartite graph can not contain an odd cycle.

Infact a bipartite graph is characterized by this property.

Koenigg’s Theorem: A graph is bipartite, iff it contains no odd


length cycles.

Graph bipartization: Converting a non-bipartite graph into a


bipartite graph. Achieved by:

• 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>}

o Each edge in a directed graph (digraph) has a direction and


is called a directed edge.

o The definitions for undirected graphs apply to directed


graphs. For example, a directed path is a sequence of
directed edges between two vertices.
GRAPH THEORY
DIRECTED GRAPHS
Note: If there is a directed edge from vertex x to vertex y, then y
is adjacent to x.

o A directed graph is called strongly connected if there is a


directed path from any vertex to any other vertex

o If we suppress the direction of the edges and the resulting


undirected graph is connected, we call the directed graph
weakly connected.
GRAPH THEORY
GRAPH THEORY
An acyclic graph, one without any cycles, is called a forest. A connected
forest is called a tree.

Thus, a forest is graph whose components are tress. The vertices of


degree 1 in
a tree are its leaves. Every non-trivial tree has at least two leaves, ends of
a longest path.

If we remove a leaf from a tree, what remains is called a -?-


GRAPH THEORY
TREES
Let G = (V, E ) be an undirected graph.
The following statements are equivalent, A
o G is a tree
o Any two vertices in G are connected by
unique simple path
B C
o G is connected, but if any edge is removed
from E, the resulting graph is disconnected
o G is connected, and | E | = | V | -1
o G is acyclic, and | E | = | V | -1 D E
o G is acyclic, but if any edge is added to E, the
resulting graph contains a cycle

F
GRAPH THEORY
SPANNING TREE

For the graph shown on the V2 V3


right two possible spanning
trees are shown below V1

For a given graph there are usually


V4 V5
several possible spanning trees

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

G = (V, E) T = (V, F) w(T) = 50

Cayley's Theorem (1889)


There are nn-2 spanning trees of a complete graph Kn
n = |V|, m = |E|
Can't solve MST by brute force (because of nn-2)

You might also like