23
Graph coloring algorithm Sanjana Urmy 13CSE030

Graph coloring algorithm

Embed Size (px)

Citation preview

Page 1: Graph coloring algorithm

Graph coloring algorithm

Sanjana Urmy13CSE030

Page 2: Graph coloring algorithm

Greedy coloring algorithm

1. Choose an order for the vertices.2. Choose a list of colors , also in same order.3.In order , color each vertex using the first

available color on the list , making sure that no two adjacent vertices are the same color.

4.Continue in this way until each vertex is colored.

Page 3: Graph coloring algorithm
Page 4: Graph coloring algorithm
Page 5: Graph coloring algorithm
Page 6: Graph coloring algorithm
Page 7: Graph coloring algorithm
Page 8: Graph coloring algorithm
Page 9: Graph coloring algorithm
Page 10: Graph coloring algorithm
Page 11: Graph coloring algorithm

Welsh Powell Algorithm• Find the degree of each vertex• List the verices in order of descending valence.

Colour the first vertex in the list• Go down the sorted list and color every vertex

not connected to the colored vertices above the same color then cross out all colored vertices in the list.

• Repeat the process on the uncolored vertices with a new color-always working in descending order of degree until all vertices are colored.

Page 12: Graph coloring algorithm

Welsh Powell Algorithm: Example

Page 13: Graph coloring algorithm
Page 14: Graph coloring algorithm
Page 15: Graph coloring algorithm
Page 16: Graph coloring algorithm

K,G,I,J,A,B,F,C.

Page 17: Graph coloring algorithm
Page 18: Graph coloring algorithm
Page 19: Graph coloring algorithm
Page 20: Graph coloring algorithm
Page 21: Graph coloring algorithm
Page 22: Graph coloring algorithm

G,J,B

Page 23: Graph coloring algorithm