multi-layer channel routing complexity and algorithms rajat k. pal annajiat alim rasel 0409052002...

Post on 20-Dec-2015

215 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Multi-Layer Channel RoutingComplexity and Algorithms

Rajat K. Pal

Annajiat Alim Rasel0409052002

annajiat@gmail.comCSE 6404 VLSI Layout Algorithms

Page 67 -> 78as a part of MS at BUET, 2009

Cell

• Circuit element• Simple• Pre-designed

C

EA D

B

F

ASIC (Standard Cell) Design Example

D C C B

A C C

D C D B

BCCC

CellMetal1Metal2

GNDVDD

C D

A BCell library

Placement [©Sherwani]

Channel

C

EA D

B

F

VLSI Layout

Channel

A D

Channelnets: set of terminals to be connected

Channel routing

Transitively Oriented Graph/ Comparability Graph

u

v w wv

u x

Transitively Oriented Graph/ Comparability Graph ??

u

v w wv

u x

Transitively Oriented Graph/ Comparability Graph

- Vertex Types(intermediate)

u (source)u

V(source)

w(sink)

w(source)

v(sink)

(sink)x

Channel Specification

5 3 2 6 1 7 4

5 3 6 2 1 7 4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

VH routin

g

Channel Specification

5 3 2 6 1 7 4

5 3 6 2 1 7 4

I 5

I 3I 2

I 6

I 1

I 7

I 4

A

D

S5 S3 S6 S2 S1 S7 S4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

Channel Intervals

Channel Intervals

S5 S3 S6 S2 S1 S7 S4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

HCG

2

3

1

45

6

7

Channel Intervals

HCG and

HNCG

2

3

1

45

6

7

S5 S3 S6 S2 S1 S7 S4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

Channel Intervals

HNCG

2

3

1

45

6

7

S5 S3 S6 S2 S1 S7 S4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

clique cover

3

4

1

2

5

7

6

While G ≠ empty

choose a maximal clique

delete the vertices of the clique

algorithm

clique cover

{1, 4, 5}

3

4

1

2

5

7

6

clique cover

{1, 4, 5}

3

7

6{ 2, 7 }

2

clique cover

{1, 4, 5}

36{ 2, 7 }

{ 3 }

clique cover

{1, 4, 5}

6{ 2, 7 }

{ 3 }

{ 6 } But, the cliquecover may not beminimum one

clique cover

{1, 4, 5}

{ 2, 7 }

{ 3 }

{ 6 } But, the cliquecover may not beminimum one

3

4

1

2

5

7

6

clique cover

{1, 4, 5} { 2, 7 }

{ 3 } { 6 }

Independent set 3

4

1

2

5

7

6

{5, 3, 6} {2, 3, 6}

{2, 1, 6}{7, 1}{7, 4}

clique cover

{1, 4, 5} { 2, 7 }

{ 3 } { 6 }

Independent set 3

4

1

2

5

7

6

{5, 3, 6} {2, 3, 6}

{2, 1, 6}{7, 1}{7, 4}

clique cover

{1, 4, 5} { 2, 7 }

{ 3 } { 6 }

Independent set

{5, 3, 6} {2, 3, 6}

{2, 1, 6}{7, 1}

I2

I7

I5

I4

I1

I3

I6

{7, 4}

For perfect graph

(G)=κ(G)

(G)= size of the max independent setκ(G) = size of the min clique cover

Minimum clique cover

3

4

1

2

5

7

6

Sort the intervals w. r. t. Li

Orient the edges b. t. r. Ri < Lj While G ≠ empty

choose a maximal clique from sorted list

delete the vertices of the clique

algorithm

3

4

1

2

5

7

6

I2

I7

I5

I4

I1

I3

I6

5

6

3

1 7

2

4

1 2

3 4

5 6 7

3

4

1

2

5

7

6

I2

I7

I5

I4

I1

I3

I6

5

6

3

1 7

2

4

3

4

1

2

5

7

6

5

6

3

1 7

2

4

5 2 7

3

4

1

2

5

7

6

5

6

3

1 7

2

4

5 2 7

3

4

1

6

5

3

7

2

5 2 7

3 1 4

3

4

1

6

5

3

7

2

5 2 7

3 1 4

63

5 2 7

3 1 4

6

Obviously, this is the minimum clique

Lemma

Lemma 3.1

For any vertices vi , vj and vk of the HNCG,if vi vj and vj vk , then vi vk

Proof From definition,

Ri < Lj and Rj < Lk

From the interval,

Lj < Rj

So, we have

Ri < Lk

So, the HNCG is acomparability graph

Lemma

Lemma 3.2

Each maximal clique computed by thealgorithm MCC1 in step 3 has exactly one

vertex from each maximal independent set of G

case 1:

There is no interval ending on the left side ofthe starting column of any interval in A

We consider any maximal independent set A

Independent set

{5, 3, 6} {2, 3, 6}

{2, 1, 6}{7, 1}

I2

I7

I5

I4

I1

I3

I6

{7, 4}

Lemma 3.2 (cont.) 5 2 7

3 1 4

6

In this case, vertices in A will be selected as the source vertex of successive maximal cliques

case 2:

There is an interval ending on theleft side of the starting column of at least

one of the intervals in A

Lemma 3.2 (cont.)

Independent set

{5, 3, 6}{2, 3, 6}

{2, 1, 6}{7, 1}

I2

I7

I5

I4

I1

I3

I6

{7, 4}

Lemma 3.2 (cont.) 5 2 7

3 1 4

6

Let, I be the rightmost intervalselected by MCC1 in C1 such

that at least one interval of A starts after I ends &

J be the interval of A with leftmost end point among the intervals

of A , starting after I ends

Independent set

{5, 3, 6}{2, 3, 6}

{2, 1, 6}{7, 1}

I2

I7

I5

I4

I1

I3

I6

{7, 4}

Lemma 3.2 (cont.) 5 2 7

3 1 4

6

So, one interval of A is chosen bythe algorithm MCC1 in C1

So, exactly one interval of A is chosen in C1

Lemma

Lemma 3.3

MCC1 computes a minimum clique cover of theHNCG, G=(V, E’) consisting of dmax cliques

Proof

dmax = size of the maximum

independent set

From, lemma 3.2

A will become emptywhen Cl is computed

Let, the size of the maximalindependent set A be l,

where l < dmax

Lemma 3.3 (cont.)

{5, 3, 6}{2, 3, 6}

{2, 1, 6}{7, 1}{7, 4}

5 2 7

3 1 4

6The last clique computed by MCC1will include the last interval fromeach maximum independent set

Lemma 3.3 (cont.)

{5, 3, 6}{2, 3, 6}

{2, 1, 6}{7, 1}{7, 4}

5 2 7

3 1 4

6The last clique computed by MCC1will include the last interval fromeach maximum independent set

So, it follows that

the number of cliques computed

by MCC1 is exactly dmax

Theorem 3.1

The construction of the HNCG, G=(V, E’) andits transitively oriented graph G*=(V, F) fromthe intervals belonging to a channel can beimplemented in O(n+e) time, where n is the

number of nets and e is the size of the HNCG

Theorem 3.1 (cont.)

orienting of the edges can be done by

scanning all the intervalsexactly once from left to right

The following cases mayoccur at a column

position while scanning

an interval starts

an interval terminates

all the intervals continue

Theorem 3.1 (cont.)

case 1: while Ii starts, if Ij S1 terminatedbefore Ii ; orient an edge vj vi in G*

case 2:If Ii terminates at current column

position, we add Ii in the set S1

case 3: No action required

Theorem 3.1 (cont.)

In any instance of the CRP, at most two intervalsmay start or terminate at the same column.In this case, both the intervals are processedone after another.

The scanning of the columns requires O (n) time

The algorithm spends constant time in

introducing each edge of G and G*

The introducing time of all the edges is O (e)

Theorem 3.2

The algorithm MCC1 correctly computes arouting solution for the two layer CRPwithout vertical constraints using dmax

tracks. MCC1 can be executed in O(n+e) time.

O (n)

O (n+e)

O (n+e)

In total,

O (n+e) time

Theorem 3.3

The algorithm MCC2 correctly computes arouting solution for the two layer CRPwithout vertical constraints using dmax

tracks. MCC2 can be executed in O(nlogn) time

Self-balancing binary search tree

Operation Big-O time

Lookup O(log n)

Insertion O(log n)

Removal O(log n)

In-order iteration over all elements O(n)

The overall worst-case Build Time is O(nlog n)

Times for various other operations in terms of number of nodes in the tree n:For some implementations these times are worst-case, while for others they are amortized.

Self-balancing binary search tree

Operation Big-O time

Lookup O(log n)

Insertion O(log n)

Removal O(log n)

In-order iteration over all elements O(n)

The overall worst-case Build Time is O(nlog n)

Times for various other operations in terms of number of nodes in the tree n:For some implementations these times are worst-case, while for others they are amortized.

In computer science, especially analysis of algorithms, amortized analysis finds the average running time per operation over a worst-case sequence of operations. Amortized analysis differs from average-case performance in that probability is not involved; amortized analysis guarantees the time per operation over worst-case performance.

O (n)

O (n+e)

O (nlogn)

O (logn)

Building Self Balancing BST of

intervals sorted on their starting column numbers - O (nlogn)

Total=nlogn+(n + e) + n + n X (logn + logn)=2n + e + nlogn + 2nlogn=2n + e + 3nlogn=nlogn

O (logn)

Vertex Representation• Class Vertex {

– int key; //starting column and sequence number in transitive orientation

– int n; //vertex name: v1, v2 … etc. Prefix “v” will be used for now on for clarity

– double endingPosition; // ending column, double value such as 3.5 indicates that it ended before column 4. Thought it should be int, but due to lack of numbers between 3 and 4, double values are used.

– int outDegree;}

Input / Initialization

• Assuming for the given example following declarations and initializations have been done1) Vertex v1, v2, v3, v4, v5, v6, v7;2) v1.n=1; v2.n=2; …………. V7.n=7;3) All vertexes know their key (startingPosition) and

endingPosition

Step 1 - Building BST

• Insert v5

k=1end=3.5

outDeg=4n = v5

Step 1 - Building BST

• Insert v3

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

Step 1 - Building BST

• Insert v6

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Step 1 - Building BST

The balance factor of a node is the height of its right subtree minus the height of its left subtree. A node with balance factor 1, 0, or -1 is considered balanced. A node with any other balance factor is considered unbalanced and requires rebalancing the tree. The balance factor is either stored directly at each node or computed from the heights of the subtrees.

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Here v5 is unbalanced

Step 1 - Building BST

In right right case, tree is balanced using left rotation. So, left rotating v5, v3, v6 from v3

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Here v5 is unbalanced

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Here v5 is now balanced

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Inserted v2

k=4end=5.7

outDeg=0n = v2

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Inserted v5

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Tree now has become unbalanced and v6, v2, v1 now forms a right right case

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Lets balance the tree using a left rotation

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Tree is now balanced

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Changed for a better view

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Inserted v7

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

K=6End=8

outDeg=0n = v7

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Tree is unbalenced. v3, v2, and v1 forms a right right case which is to be solved using a left rotation

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

K=6End=8

outDeg=0n = v7

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Tree is now balenced

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

K=6End=8

outDeg=0n = v7

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Insert v7

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

V1, v7, v4 forms a right right case requiring to be balanced

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

Step 1 - Building BST

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Tree is now balanced

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

Step 1 - Building BST, Done!

k=1end=3.5

outDeg=0n = v5

k=2end=4.5

outDeg=0n = v3

k=3end=5.5

outDeg=0n = v6

Better view

k=4end=5.7

outDeg=0n = v2

K=5End=6.5

outDeg=0n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

Channel Intervals

S5 S3 S6 S2 S1 S7 S4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

HCG

2

3

1

45

6

7

Step 2 – Construct HNCG

Channel Intervals

HCG and

HNCG

2

3

1

45

6

7

Step 2 – Construct HNCG

S5 S3 S6 S2 S1 S7 S4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

Channel Intervals

HNCG

2

3

1

45

6

7

Step 2 – Construct HNCG

S5 S3 S6 S2 S1 S7 S4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

Channel Intervals

HNCG

2

3

1

45

6

7

Step 2 – Transitive Orientation

S5 S3 S6 S2 S1 S7 S4

I 5

I 3

I 2

I 6

I 1

I 7

I 4

A

D

• Similarly, whole graph is made transitively oriented and “outDegree” field of all vertexes are now updated

v3

v4

v1

v2

v5

v7

v6

5

6

3

1 7

2

4

Step 2 – Transitive Orientation

• While (! tree.empty()){– min = tree.findMinVertex();– C = C U min– Tree.delete(min)– If min.outDegree <> 0 then // not a sink

• Next = tree.findGreaterThan(min.endingPosition)

– Else • CliqueCover = CliqueCover U C• C = Empty

}

Step 3 – Overview

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Find min

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Find min

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Min = v5Add v5 to Clique, C

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Tree.delete (v5)

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Tree.delete (v5)

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

v5.outDeg > 0, so, its not sink, continuetree.findGreaterThan(v5.end)

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

min = tree.findGreaterThan(v5.end)// 4 (v2) is greater than v5.end = 3.5

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Add min to Clique

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Add min to Clique

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Now to delete v2, we need to swap v6 (3) and v2 (4)

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=3end=5.5

outDeg=2n = v6

Now to delete v2, we need to swap v6 (3) and v2 (4)

k=4end=5.7

outDeg=2n = v2

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

swapped v6 (3) and v2 (4)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

Now delete v2

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

Deleted v2

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

V2.outDeg > 0, so, not a sink, continueMin = tree.FindGreaterThan(v2.end)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

Min = tree.FindGreaterThan(v2.end)// 6 (v7) is greater than 5.7 (end of v2)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

Min = tree.FindGreaterThan(v2.end)// 6 (v7) is greater than 5.7 (end of v2)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

Add min to clique

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

Add min to clique

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

To delete 6 (v7), we need to swap5 (v1) and 6 (v7)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=6End=8

outDeg=0n = v7

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

Swapped 5 (v1) and 6 (v7)

k=3end=5.5

outDeg=2n = v6

K=6End=8

outDeg=0n = v7

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

delete 6 (v7)

k=3end=5.5

outDeg=2n = v6

K=6End=8

outDeg=0n = v7

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

Step 3 - Details

k=1end=3.5

outDeg=4n = v5

k=2end=4.5

outDeg=3n = v3

k=4end=5.7

outDeg=2n = v2

V7.outDeg is 0, so, v7 is a sink. So, current clique is complete. Hiding deleted vertices andGoing to build next clique …

k=3end=5.5

outDeg=2n = v6

K=6End=8

outDeg=0n = v7

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Min = tree.FindMin()We get 2 (v3)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Added 2 (v3) to cliqueNow delete 2 (v3)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }{ v3 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

deleted 2 (v3)Tree is now unbalanced in a right right case

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }{ v3 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Rebalancing using a left rotation

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }{ v3 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Rebalance using a left rotation

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }{ v3 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

2 (v3) was not a sink, so continueTree.findGreaterThan(v3.end)// 5 (v1) is greater than 4.5 (end of v3)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }{ v3 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Tree.findGreaterThan(v3.end)

// 5 (v1) is greater than 4.5 (end of v3)

Add v1 to clique

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }{ v3, v1 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Swap 3 (v6) and 5 (v1)

k=3end=5.5

outDeg=2n = v6

K=5End=6.5

outDeg=1n = v1

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Swapped 3 (v6) and 5 (v1)

K=5End=6.5

outDeg=1n = v1

k=3end=5.5

outDeg=2n = v6

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Now we can easily delete 5 (v1)

K=5End=6.5

outDeg=1n = v1

k=3end=5.5

outDeg=2n = v6

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

deleted 5 (v1)Min=tree.FindGreaterThan(v1.end)// 7 (v4) is greater than 6.5

K=5End=6.5

outDeg=1n = v1

k=3end=5.5

outDeg=2n = v6

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

v1 was not a sink, so we can continueAdd v4 to clique

K=5End=6.5

outDeg=1n = v1

k=3end=5.5

outDeg=2n = v6

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1, v4 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Delete v4

K=5End=6.5

outDeg=1n = v1

k=3end=5.5

outDeg=2n = v6

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1, v4 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Delete v4

K=5End=6.5

outDeg=1n = v1

k=3end=5.5

outDeg=2n = v6

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1, v4 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

Deleted v4

K=5End=6.5

outDeg=1n = v1

k=3end=5.5

outDeg=2n = v6

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1, v4 }

Step 3 - Details

k=2end=4.5

outDeg=3n = v3

V4.outDeg was zero, hence currentclique is complete. Hiding deleted vertices for clarity

K=5End=6.5

outDeg=1n = v1

k=3end=5.5

outDeg=2n = v6

K=7End=9

outDeg=0n = v4

{ v5, v2, v7 }

{ v3, v1, v4 }

Step 3 - Details

Min=tree.findMin()// we get 3 (v6)Add to clique

k=3end=5.5

outDeg=2n = v6

{ v5, v2, v7 }

{ v3, v1, v4 }

{ v6 }

Step 3 - Details

delete 3 (v6)

k=3end=5.5

outDeg=2n = v6

{ v5, v2, v7 }

{ v3, v1, v4 }

{ v6 }

Step 3 - Details

• deleted 3 (v6)• Tree is now empty, so we stop and we are

done!• We have found 3 minimum cliques in our

clique cover!

{ v5, v2, v7 }

{ v3, v1, v4 }

{ v6 }

Reference• Multi-Layer Channel Routine Complexity and Algorithms by

Rajat K. Pal• Graph theory and its applications to problems of society by

Fred S. Roberts• Introduction to Graph Theory by Douglas B. West• Slide 2 -> 3 is from teacher.buet.ac.bd/saidurrahman/cse6404• Slide 4 -> 5 from Mr. Jawaherul and 14 -> 47 from Mr. Emran• From en.wikipedia.org, Binary_search_tree, Tree_rotation,

Self-balancing_binary_search_tree• webpages.ull.es/users/jriera/Docencia/AVL/AVL%20tree

%20applet.htm

© www.awesomebackgrounds.com

Suggestions

Please feel free to send comments / suggestions / criticisms to Annajiat Alim Raselannajiat @ gmail . com01711935759http://annajiat.googlepages.com

top related