exact coloring of real-life graphs is easy

71
Exact Coloring of Real-Life Graphs is Easy 34th DAC, June 10, 1997 Olivier Coudert Synopsys, Inc.

Upload: olivier-coudert

Post on 15-Apr-2017

191 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Exact coloring of real-life graphs is easy

Exact Coloring of Real-Life Graphs is Easy

34th DAC, June 10, 1997

Olivier CoudertSynopsys, Inc.

Page 2: Exact coloring of real-life graphs is easy

Summary

Introduction

Why is Coloring Difficult?

Maximum Clique

Experiments & Conclusion

Page 3: Exact coloring of real-life graphs is easy

Graph Coloring

|clique| |color|

Page 4: Exact coloring of real-life graphs is easy

Graph Coloring Scheduling Microcode optimization Register allocation Resource sharing State encoding Planar routing Frequency assignment Network optimization ....

Page 5: Exact coloring of real-life graphs is easy

Graph Coloring

Graph coloring is NP-complete Graph coloring is not polynomially approximable

Heuristics coloring can be arbitrarily farfrom the optimum solution Heuristics coloring in practice is 10% off,up to 100% off, the optimum solution

Page 6: Exact coloring of real-life graphs is easy

Summary

Introduction

Why is Coloring Difficult?

Maximum Clique

Experiments & Conclusion

Page 7: Exact coloring of real-life graphs is easy

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah b |clique| |color| blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

Page 8: Exact coloring of real-life graphs is easy

|clique| |color|

Page 9: Exact coloring of real-life graphs is easy

|clique| |color|

Page 10: Exact coloring of real-life graphs is easy

|clique| |color|

Page 11: Exact coloring of real-life graphs is easy

Sequential ColoringFind a clique

Page 12: Exact coloring of real-life graphs is easy

Sequential ColoringColor the clique

colors

Page 13: Exact coloring of real-life graphs is easy

Sequential ColoringColor the remaining vertices one by one

colors

Page 14: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 15: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 16: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 17: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 18: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 19: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 20: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 21: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 22: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 23: Exact coloring of real-life graphs is easy

Sequential ColoringBacktrack to look for a better solution

colors

Page 24: Exact coloring of real-life graphs is easy

Sequential Coloringetc...Exhaustively enumerate the colorings

Page 25: Exact coloring of real-life graphs is easy

Sequential Coloring

EXP

Page 26: Exact coloring of real-life graphs is easy

Sequential Coloring

Page 27: Exact coloring of real-life graphs is easy

Use a bound to prunethe search space

Branch-and-Bound

Page 28: Exact coloring of real-life graphs is easy

Sequential Coloring

Find a cliqueColor the cliqueIf all vertex are colored, new coloringIf |clique| = #used colors, abort

Select an uncolored vertexColor it w/o conflictIf it is not possible, backtrack

Page 29: Exact coloring of real-life graphs is easy

Branch-and-bound with aunique, static, lower bound

Sequential Coloring

Page 30: Exact coloring of real-life graphs is easy

Consequences in General...

If |MaxClique| |MinColor|, one has to enumerate all colorings before terminating

Fact 1:

Almost all graphs satisfy|MaxClique| |MinColor|

Fact 2:

Page 31: Exact coloring of real-life graphs is easy

…But in Practice

Real-life graphs appear to be 1-perfect, i.e.,|MaxClique| =|MinColor|

Fact 3:

Page 32: Exact coloring of real-life graphs is easy

Consequence:

To color real-life graphs, find a maximum clique first.

Page 33: Exact coloring of real-life graphs is easy

Sequential ColoringWhat if we find the maximum clique?

Page 34: Exact coloring of real-life graphs is easy

Sequential ColoringColor the clique

Page 35: Exact coloring of real-life graphs is easy

Sequential ColoringColor the remaining vertices one by one

Page 36: Exact coloring of real-life graphs is easy

Sequential Coloring

size of the clique = 4number of colors = 4

Page 37: Exact coloring of real-life graphs is easy

Here, no backtrack is needed

Sequential Coloring

size of the clique = number of colors

Page 38: Exact coloring of real-life graphs is easy

Summary

Introduction

Why is Coloring Difficult?

Maximum Clique

Experiments & Conclusion

Page 39: Exact coloring of real-life graphs is easy

Maximum CliqueBranch-and-bound

Lower bound: a coloring

|clique| |color|

Page 40: Exact coloring of real-life graphs is easy

q-Color Pruning

further pruneTakes advantage of a coloring to the search spacefurther prune

search space reduced by x100

Page 41: Exact coloring of real-life graphs is easy
Page 42: Exact coloring of real-life graphs is easy
Page 43: Exact coloring of real-life graphs is easy
Page 44: Exact coloring of real-life graphs is easy
Page 45: Exact coloring of real-life graphs is easy

clique = 3

Page 46: Exact coloring of real-life graphs is easy

Wait!

clique = 3

Page 47: Exact coloring of real-life graphs is easy

clique = 3

Page 48: Exact coloring of real-life graphs is easy

clique = 3 color = 4

Page 49: Exact coloring of real-life graphs is easy

clique = 3 color = 4

q color clique

Page 50: Exact coloring of real-life graphs is easy

clique = 3 color = 4

q 4 3

Page 51: Exact coloring of real-life graphs is easy

clique = 3 color = 4

q 2

Page 52: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 53: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 54: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 55: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 56: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 57: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 58: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 59: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 60: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 61: Exact coloring of real-life graphs is easy

clique = 3 color = 4 q = 2

Page 62: Exact coloring of real-life graphs is easy
Page 63: Exact coloring of real-life graphs is easy
Page 64: Exact coloring of real-life graphs is easy

Solving Max. Clique

1

10

100

1000

10000

100000

1000000

withoutwith

> 11 days

1 sec

2mn

15mn

3h

10 sec

1 day

Page 65: Exact coloring of real-life graphs is easy

As a Heuristic:

q-color pruning finds a maximum clique in less than 10 backtracks,

where 1000 backtracks, and up to 10000 backtracks, were previously necessary

Page 66: Exact coloring of real-life graphs is easy

Summary

Introduction

Why is Coloring Difficult?

Maximum Clique

Experiments & Conclusion

Page 67: Exact coloring of real-life graphs is easy

Facts

Real-life graphs seem to be 1-perfect

1-perfect graphs are easy to color,providing that one finds a maximum clique

The maximum clique algorithm quickly finds the optimum lower bound

Page 68: Exact coloring of real-life graphs is easy

Experiments

> 600 real-life examples in scheduling, register allocation, planar routing, frequency assignment

They are all 1-perfect graphs

Colored exactly in seconds, while heuristics are10% off on average, up to 100% off

Page 69: Exact coloring of real-life graphs is easy

Conclusion

One can color real life graphs exactly with no more time

than heuristics

Page 70: Exact coloring of real-life graphs is easy

Thank you!

Page 71: Exact coloring of real-life graphs is easy