# Colorability - Smith College Department of Computer Science

```Modeling Using Colorability
Presented by: Kelley Louie
CSC 252 Algorithms
252a-aj
Introduction


All of the algorithms that we have learned
in class have real world applications such as
social science problems.
By associating a problem to a graph, we can
solve the social science problem.
Summary


History
Two Models
– Committee Scheduling
– Routing Garbage Trucks



Planar Graphs
Bipartite Graphs
LEDA implementation
History: Four Color Problem



In 1852, Francis Guthrie noticed that he could color the map of
England in four colors. He asked his brother, Frederick Guthrie,
if every map has the chromatic number of four. This same
question was relayed to London mathematican Augustus de
Morgan by his student Frederick Guthrie.
In 1853, Kempe devised a proof, but eleven years later, Heawood
disproved the correctness. Several other proofs were also found,
The theorem was finally proved by Appel and Haken in 1976 using
a computer to solve difficult cases and 1200 hours of computing
time. This employed using techniques called reducibility and
discharging. The theorem by Appel and Haken remains a disputed
proof because part of the proof uses a computer and can not be
verified by hand, and the part that is checkable by hand is
complex and tedious and no one has been able to verify it.
Definition


chromatic number χ(G) - minimum
number k such that Graph G is
colorable in k-colorings
clique - subgraph Gc that is a complete
graph
Committee Scheduling



Problem: assign meeting times such that there are
no conflicts between members
Solution: create a corresponding graph with the
condition that no two adjacent vertices are
assigned the same time
instead of times, assign colors such that no two
adjacent vertices share the same color
Graph G
– vertices: all the committees that need regular meeting
times
– edge: joins two vertices iff share a common member
Graph of Committee Scheduling


This graph has a chromatic number of three
because the largest clique is 3.
Credit: Applied Combinatorics p. 98
Routing Garbage Trucks


Posed by the New York City Department of
Sanitation (Beltrami and Bodin [1973])
Tour of a truck is a scheduling of sites to visit
within one day
– each site i visited ki times in a week
– tours partitioned among six days (Sunday is not a
working day) such that
• each site is visited once a day
• no day assigned more tours than the number of trucks
– total time for all trucks is minimal
Routing Continued



total time of the tours
Test if the set satisfies the condition that it
must be partitioned into 6 days
To determine if a possible solution can be
partitioned into six parts:
– create Graph (G)
– determine if the graph can be colored in 6 or
less colors
Graph of Garbage Tour


The graph on the left is an example of the routing
problem without any colored vertices.
The graph on the right has chromatic number six.
Determine 6-Colorable Quickly


Use the Strong Perfect Graph Conjecture
– definition: G is γ-perfect iff neither G or any
subgraph Gc has an odd circuit of 3 or greater
– γ-perfect: if for all subgraphs Gc χ(G) &gt;= ω(G)
yes - use the old algorithm to check if the
chromatic number is 6
– start from one vertex and check if the chromatic
number is 6

no - determine if the graph has a clique of 6 or
greater
Determining 6-Color in Detail

For γ-perfect graphs, the chromatic number
can be calculated by the finding the number
of vertices in the largest clique.
Planar Graphs


Four Color Theorem
– all planar graphs are colorable in four colors
Test if Graph G is planar
– K3, 3 and K5 are not planar
– a graph is planar iff it has no subgraph homeomorphic
to K3, 3 or K5
– a graph is planar if it has no subgraph that is K3, 3 or K5
Examples of Non-planar



left: G is nonplanar because it has a subgraph S that is
homeomorphic to K3, 3 as shown by the open circles and
closed circles
right: G is nonplanar because it has a subgraph S that is
homeomorphic to K5 as shown by the vertex A being
adjacent to C and D and with added vertexes to B and E
credit: Discrete Mathematics with Graph Theory p. 471
Bipartite Graphs


all bipartite graphs are colorable in two
colors
color a bipartite graph
–
–
–
–
first node is one color
adjacent node is the other color
continue BFS with alternating color
assignments
– end only when all the nodes are colored
LEDA implementation

a planar graph has at most
five neighbors as stated in the
LEDA book Lemma 47
– if node v has less than five
neighbors
• recursively color the neighbors
and color v in the color not
used by its neighbors
– if node v has five neighbors
vertices, w and z, to its
neighbor v
• remove v and any parallel
edges
• five color the graph recursively
• unmerge w and z by coloring w
and z the color used in the
merged graph
• color v a color not used by its
neighbors

Credit: LEDA: A Platform for Combinatorial and
Geometric Computing p. 578
Five Colorability





It has been proven that planar graphs can be colored in 5 or less colors.
Proof by induction
if V = 1, then yes the graph is colorable in 5 or less colors, to be more specific, it can colored in exactly one
color
prove for V = k+1, assume G is planar
– Corollary 13.6 states that every planar graph has at least one vertex v of at most degree 5
– delete this vertex of at most degree 5, and then G0 can be colored in 5 or less colors by the induction
hypothesis
• color the vertices neighboring v, if one color has not been used, color v with this last remain,
vertex v has less than 5 neighbors
• if v has 5 neighbors, there are two cases
– G0 has no path from v1 to v3 all colored 1 or 3
• subgraph H with vertices colored 1 or 3 which start at v1, alternate coloring H with
colors 1 and 3, so v1 and v3 are colored 3 and v can be colored 1
– G0 has a path from v1 to v3 with vertices all colored 1 or 3
• path of v and v1 produces a circuit that does not enclose both v2 and v4, so must
cross the path at a vertex within the path. There is no path in G0 from v2 to v4 that
just uses color 2 and 4, since it crosses another vertex. Now we have the same case
as above.
Credit: Discrete Mathematics with Graph Theory
Possible Implementation





assume Graph G is stored as an adjacency list, perform a search
through the list to determine if each node has less than five neighbors,
this would take n+m time
if less than five neighbors, then five color the graph recursively
if five neighbors, then perform the merging and unmerging, and color
the graph
coloring the graph would require visiting all the nodes once again
the most time spent would be to determine the degree of the nodes, this
would take O(n+m), coloring would take O(n+m), total = O(n+m)
Conclusion





Colorability is NP-hard.
For some problems, determining the type of graph leads to the
chromatic number.
In general, any type of scheduling problem can be related to a
colorable graph. Therefore, by using techniques to determine the
chromatic number of the graph, one can find organize a schedule to
avoid all possible conflicts.
It is not possible to just find the largest clique number and assume that
this s the chromatic number because finding the largest clique is NPcomplete.
For the routing problem, it was simpler to find a solution because the
number of colors were set.
Acknowledgements

Discrete Mathematical Models: with applications to social, biological,
and environmental problems
– Fred S. Roberts

Applied Combinatorics
– Fred S. Roberts

Discrete Mathematics with Graph Theory
– Edgar G. Goodaire &amp; Michael M. Parmenter

Lov&aacute;sz’s reduction of Colorability to 3-Colorability
– http://www.cs.rutgers.edu/~chvatal/notes/color.html

The Four Color Theorem
– http://www.math.gatech.edu/~thomas/FC/fourcolor.html

Graphs And Their Uses
– Oystein Ore

LEDA: A Platform for Combinatorial and Geometric Computing
– Kurt Mehlhorn &amp; Stefan N&auml;her
Further Information

Links to various coloring sites including
source codes for coloring programs
– http://www.cs.ualberta.ca/~joe/Coloring/index.
html

Dna computing to solve colorability
– http://cism.jpl.nasa.gov/program/RCT/DNACo
mpUD.html
Contributions




I found and read many books about colorability to get a better
understanding of the different theorems associated with graph coloring.
Unfortunately, I did not find a heuristic for solving colorability. The
closest solutions I have found involved theorems that prove whether or not
a graph is planar. If so, the graph can be colored in four or less colors, if
the Four Color Theorem holds to be true. It has been proven that planar
graphs are colorable in five or more colors.
I searched the internet for relevant information, but most sites dealt only
with the fact that colorability is NP-hard and that many researchers are
trying reduce colorability to 3-colorability, which is NP-hard.
I used LEDA to illustrate the algorithm that it employs to display 5colorability. Along with LEDA, I read the book to understand how the
algorithm works to color the graph.
I briefly stated a possible implementation of five colorability.
```