Professional Documents
Culture Documents
Lec - 4 Final
Lec - 4 Final
Lec - 4 Final
1
Contents
• Introduction
• Terminology
• Representation of Graphs
– Adjacency List
– Adjacency Matrix
2
Introduction
• Graphs are fundamental to VLSI physical design.
3
Introduction
Some of the applications of Graphs in Physical Design are:
4
Introduction
• Routing: Graphs help routing algorithms for optimal wire
connections.
5
Graph Representation of the Logic Circuit
A
G1
B
G3 Y
C
D G2
6
Terminology
• Graph: A graph G(V, E) is made up of two sets – the set of nodes
or vertices V and the set of edges E.
b
c
a
f
d
g
e
V = {a, b, c, d, e, f, g}
E = {(a, b), (b, c), (c, d), (d, e), (e, g), (g, f), (a, g), (b, f), (c, e)}
7
Terminology
• Hypergraph: Consists of nodes and hyperedges, with each
hyperedge being a subset of two or more nodes.
Hyperedge 4
1 5
8
Terminology
• Degree of the node: Number of its incident edges.
9
Terminology
• Undirected Graph: Represents only unordered node relations
with no directed edges.
10
Terminology
11
Terminology
• Cyclic Graph: A directed graph has at least one directed cycle.
Otherwise, it is an Acyclic Graph.
12
Terminology
13
Terminology
• Complete Graph: A graph in which an edge connects each node
to every other node.
n(n−1)
• Contains nC2 = edges
2
14
Terminology
• Connected Graph: A graph with at least one path between each
pair of nodes.
15
Terminology
• Tree: A graph with n nodes connected by n – 1 edges.
– A tree does not contain any cycles.
• which means that adding an edge between two nodes that are not connected
would create a cycle.
16
Terminology
Graph Tree
17
Terminology
• Spanning Tree: A connected, acyclic subgraph G’ contained within
G(V, E) that includes (spans) every node v ϵ V.
18
Representation of Graphs
• There are two standard ways of representing a graph:
– Adjacency Lists
• For Sparse graphs – for which |E| is much less than |V|2, Adjacency list
representation is preferred as they provide compact representation.
– Adjacency Matrices
• For dense graphs – |E| is close to the |V|2,
Adjacency Matrix representation is preferred.
19
Adjacency List Representation of Graphs
• The adjacency-list representation of a graph G = (V, E) consists of
an array Adj of |V| lists, one for each vertex in V.
• For each u ϵ V, the adjacency list Adj[u] contains all the vertices v
such that there is an edge (u, v) ϵ E.
20
1 2 6 /
2 3 1 6 /
3 2 6 5 4 /
4 3 5 /
5 6 4 3 /
6 1 2 3 5 /
Adj
21
1 2 4 5 /
2 3 4 /
3 3 /
4 3 5 /
5 2 /
Adj
22
Representation of Graphs
• For example, let G = (V, E) be a weighted graph with weight
function w.
– The weight w(u, v) of the edge (u, v) ϵ E can be stored with vertex v
in u’s adjacency list.
23
2 1 2 4 5 /
1
4 2 3 4 /
6 7 9 3 3 /
8 4 3 5 /
5
3 5 2 /
Adj
24
Adjacency Matrix Representation of Graphs
• The adjacency matrix representation of a graph G consists of a
|V| × |V| matrix A = (aij) such that
1 If (i, j) ϵ E,
aij =
0 otherwise.
25
1 2 3 4 5 6
1 0 1 0 0 0 1
2 1 0 1 0 0 1
3 0 1 0 1 1 1
4 0 0 1 0 1 0
5 0 0 1 1 0 1
6 1 1 1 0 1 0
26
1 2 3 4 5
1 0 1 0 1 1
2 0 0 1 1 0
3 0 0 1 0 0
4 0 0 1 0 1
5 0 1 0 0 0
27
Adjacency Matrix Representation of Graphs
• For example, if G = (V, E) is a weighted graph with edge-weight
function w.
– The weight w(u, v) of the edge (u, v) ϵ E can be stored as the entry in
row u and column v of the adjacency matrix.
28
1 2 3 4 5
1 0 2 0 4 6
2
1 2 0 0 1 7 0
4
6 7 9 3 0 0 9 0 0
8 4 0 0 5 0 3
5
3 5 0 8 0 0 0
29
Adjacency Matrix vs Adjacency List
Adjacency List Adjacency Matrix
The amount of memory it requires is Θ(V+E). The adjacency matrix of a graph requires
Θ(V2) memory
Finding each edge in the graph takes Θ(V+E) Because finding each edge in the graph
time. requires examining the entire adjacency
matrix, doing so takes Θ(V2) time.
30
Classes of Graphs in Physical Design
• Layouts consist of collections of rectangles.
31
Classes of Graphs in Physical Design
• To optimize the arrangement of lines or rectangles in two or three
dimensions, various graphs are defined to represent their
relationships and adjacencies.
32
Graphs Related to a Set of Lines
• Lines can be classified into two types:
A
lA rA
33
Graphs Related to a Set of Lines
• Interval: An interval is represented by its left and right endpoints,
denoted by li and ri, respectively for lines aligned to axes.
A
lA rA Interval A: (lA, rA)
34
Graphs Related to a Set of Lines
• Given a set of intervals I = {I1, I2, .., In}, three graphs are defined
based on their different relationships.
– Overlap graph
– Containment graph
– Interval graph
F B
D E
B C
A E F
A
C D
37
Containment graph
• Containment graph GC = (V, EC), is defined as F
D E
– V = {vi | vi represents interval Ii} B C
A
– EC = {(vi, vj) | li < lj , ri > rj}
• An edge is defined between vi and vj if interval Ii completely
contains Ij.
38
Containment graph
F D C
D E
B C
A B
A
F E
39
Interval graph
• Interval graph GI = (V, EI), is defined as F
D E
– V = {vi | vi represents interval Ii} B C
A
– EI = EO U EC
• An edge is defined between vi and vj if interval Ii has a non-empty
intersection with Ij.
40
Interval graph
F B F
D E
B C
A E
A
C D
41
Permutation Graph
• Matching diagram: A matching diagram is a diagram where all the
lines begin at a designated y-coordinate and end at another
specified y-coordinate. This case typically occurs in channel
routing.
• Permutation graph GP = (V, EP), is defined as
– V = {vi | vi represents interval Ii}
– EC = {(vi, vj) | if line i intersects line j}
42
Permutation Graph
1 2 3 4 5 1
Channel 2 3
3 5 4 2 1 4 5
43
Circle Graph
1 2 3 4
2 3
6 2
1 4
5 5
6 5
4 1 3 6
44
Graphs Related to a Set of Rectangles
• Given a set of rectangles R = {R1, R2, .., Rm} corresponding to a
layout in a plane, a neighborhood graph is a graph G = (V, E),
where
45
Graphs Related to a Set of Rectangles
• The neighborhood graph is used in the global routing phase of
design automation.
46
Neighborhood Graph
B
A A C
C B D
E
D F E
47
Graph Problems Related to Physical Design
• Independent Set Problem:
– Instance: Graph G = (V, E), positive integer K ≤ |V|.
– Question: Does G contain an independent set of size K or more, i.e., a
subset V’ ⊂ V such that |V’| ≥ K and such that no two vertices in V’ are
joined by an edge in E?
• The problem is NP-complete for general graphs.
• The problem is solvable in polynomial time for
interval, permutation, and circle graphs.
48
Graph Problems Related to Physical Design
• Graph K – Colorability:
– Instance: Graph G = (V, E), positive integer K ≤ |V|.
– Question: Is G K- colorable, i.e., does there exist a function f : V → {1, 2, ..,
K} such that f(u) ≠ f(v) whenever {u, v} ϵ E?
49
Graph Problems Related to Physical Design
• Clique Problem:
– Instance: Graph G = (V, E), positive integer K ≤ |V|.
– Does G contain a clique of size K or more, i.e., a subset V’ ⊂ V such that |V’| ≥
K and such that every two vertices in V’ are joined by an edge in E ?
50
51
Thank You
52