Академический Документы
Профессиональный Документы
Культура Документы
By
S.Umadevi
Asst.Prof(Sr)
INTRODUCTION
Components of Partitioning
Physical Design Flow
Needs for Partitioning
Partitioning at different levels
Golden Rules of Partitioning
Classification of Partitioning
Algorithm
Output:
Preprocessing Algorithm
Output:
– Problem
– Kernighan and Lin Algorithm
– Presentation based on
• http://www.comp.nus.edu.sg/~cs5234/2007-
08/Lectures/L06/L06-Graph-Partitioning.ppt
Problem Formulation
• Input: A weighted graph G = (V, E) with
– Vertex set V. (|V| = 2n)
– Edge Set E. (|E| = e)
– Cost cAB for each edge (A, B) in E.
• Output: 2 subsets X & Y such that
– V = X Y and X Y = { } (i.e. partition)
– Each subset (group) has n vertices
– Total cost of edges “crossing” the partition is minimized.
X = { a, c, e }
Y = { b, d, f }
KL algorithm (2a)
a
3
b Compute the gain values of moving
1
node x to the others set:
4 2
2 c
2
d Gx = Ex - Ix
4
Ex = cost of edges connecting node x
3 1
6
with the other group (extra)
e f Ix = cost of edges connecting node x
within its own group (intra)
cut-size = 3+1+2+4+6 = 16
Ga = Ea – Ia = – 3 (= 3 – 4 – 2)
X = { a, c, e } Gc = Ec – Ic = 0 (= 1 + 2 + 4 – 4 – 3)
Y = { b, d, f } Ge = Ee – Ie = + 1 (= 6 – 2 – 3)
Gb = Eb – Ib = + 2 (= 3 + 1 –2)
Gd = Ed – Id = – 1 (= 2 – 2 – 1)
Gf = Ef – If = + 9 (= 4 + 6 – 1)
KL algorithm (2b)
3
a b Cost saving when exchanging a and b is
4 1 2 essentially Ga + Gb
2
2 c d However, the cost saving 3 of the direct
3 4 1 edge was counted twice. But this edge
6 still connects the two groups
e f
Hence, the real “gain” (i.e. cost saving)
of this exchange is gab = Ga + Gb - 2cab
X = { a, c, e } Ga = Ea – Ia = – 3 (= 3 – 4 – 2)
Y = { b, d, f } Gb = Eb – Ib = + 2 (= 3 + 1 – 2)
gab = Ga + Gb – 2cab = – 7 (= – 3 + 2 – 2.3)
KL algorithm
G = (3)
–3
G = 0
a Gb = +2
Gd = –1
c
3
a b Ge = +1 Gf = +9
4 1 2
2 Compute all the gains
2 c d
4
3 1
gab = Ga + Gb – 2wab = –3 + 2 – 23 = –7
6
e f gad = Ga + Gd – 2wad = –3 – 1 – 20 = –4
gaf = Ga + Gf – 2waf = –3 + 9 – 20 = +6
cut-size = 16 gcb = Gc + Gb – 2wcb = 0 + 2 – 21 = 0
gcd = Gc + Gd – 2wcd = 0 – 1 – 22 = –5
Pair with gcf = Gc + Gf – 2wcf = 0 + 9 – 24 = +1
maximum gain geb = Ge + Gb – 2web = +1 + 2 – 20 = +3
ged = Ge + Gd – 2wed = +1 – 1 – 20 = 0
gef = Ge + Gf – 2wef = +1 + 9 – 26 = –2
KL algorithm (4)
3
a b f b
1
4 1 2 4 1 2
3
2 2
2 c d c d
3 4 1 6 3 4
6 2
e f e a
cut-size = 16 cut-size = 16 – 6 = 10
cut-size = 13
G”e = G’e + 2ced – 2cec = –7 + 2(0 – 3) = –1
G”b = G’b + 2cbd – 2cbc= –4 + 2(2 – 1) = –2
Modification