CSC 1300 – Discrete Structures Villanova University
Villanova CSC 1300 - Dr Papalaskari 1 Major Themes • Vertex coloring • Chroma c number χ(G) • Map coloring • Greedy coloring algorithm • Applica ons
Villanova CSC 1300 - Dr Papalaskari 2 Vertex Colorings Adjacent ver ces cannot have the same color
Chroma c number χ(G) = least number of colors needed to color the ver ces of a graph so that no two adjacent ver ces are assigned the same color?
Source: “Discrete Mathema cs” by Chartrand & Zhang, 2011, Waveland Press. 4 What is the least number of colors needed for the ver ces of this graph so that no two adjacent ver ces have the same color? χ(G) =
Source: “Discrete Mathema cs with Ducks” by Sara-Marie Belcastro, 2012, CRC Press, Fig 13.1. 5 Map Coloring Region è vertex Common border è edge
G A D C E B F G H I
Villanova CSC 1300 - Dr Papalaskari 8 Map Coloring What is the least number of colors needed to color a map?
Villanova CSC 1300 - Dr Papalaskari 9 Coloring the USA
h p://www.printco.com/pages/State%20Map%20Requirements/USA-colored-12-x-8.gif
h p://people.math.gatech.edu/~thomas/FC/usa.gif
Villanova CSC 1300 - Dr Papalaskari 11 Four color theorem
Every planar graph is 4-colorable
The proof of this theorem is one of the most famous and controversial proofs in mathema cs, because it relies on a computer program. It was first presented in 1976. A more recent reformula on can be found in this ar cle:
Formal Proof – The Four Color Theorem, Georges Gonthier, No ces of the American Mathema cal Society, December 2008. h p://www.ams.org/no ces/200811/tx081101382p.pdf
Villanova CSC 1300 - Dr Papalaskari 12 Four color theorem
Every planar graph is 4-colorable Do you always need four colors?
Villanova CSC 1300 - Dr Papalaskari 13 Four color theorem
Every planar graph is 4-colorable What about non-planar graphs?
K3,3 K5
Villanova CSC 1300 - Dr Papalaskari 14 Example
Villanova CSC 1300 - Dr Papalaskari 15 Example
Source: “Discrete Mathema cs with Ducks” by Sara-Marie Belcastro, 2012, CRC Press, Fig 13.1. Villanova CSC 1300 - Dr Papalaskari 16 Example
Source: “Discrete Mathema cs with Ducks” by Sara-Marie Belcastro, 2012, CRC Press, Fig 13.1. Villanova CSC 1300 - Dr Papalaskari 17 Chroma c Numbers of Some Graphs • χ(G) = 1 iff ...
• For Kn, the complete graph with n ver ces, χ(Kn) =
Corollary: If a graph has Kn as its subgraph, then χ(Kn)=
• For Cn, the cycle with n ver ces, χ(Cn) =
• For any bipar te graph G, χ(G) =
• For any planar graph G, χ(G) ≤ 4 (Four Color Theorem)
Villanova CSC 1300 - Dr Papalaskari 18 Applica ons of Graph Coloring
• map coloring • scheduling – eg: Final exam scheduling • Frequency assignments for radio sta ons • Index register assignments in compiler op miza on • Phases for traffic lights
Villanova CSC 1300 - Dr Papalaskari 19 Example: Schedule these exams, avoiding conflicts
Monday Tuesday Wednesday
CSC 2053 CSC 1052 CSC 1300
CSC 2400 CSC 4480 CSC 1700 CSC 2014
Villanova CSC 1300 - Dr Papalaskari 20 Earlier example – seen as scheduling constraints
CSC 1700
CSC 2014 CSC 2053 CSC 2400 CSC 4480
CSC 1300 CSC 1052
Villanova CSC 1300 - Dr Papalaskari 21 Revised Exam Schedule:
CSC 2053 Monday Tuesday Wednesday CSC 1700 ?? CSC 1052
CSC 1300 CSC 4480 CSC 2014
CSC 2400
Villanova CSC 1300 - Dr Papalaskari 23 Graph coloring algorithm?
Source: “Discrete Mathema cs with Ducks” by Sara-Marie Belcastro, 2012, CRC Press, p374. Villanova CSC 1300 - Dr Papalaskari 24 Compu ng the Chroma c Number
There is no efficient algorithm for finding χ(G) for arbitrary graphs. Most computer scien sts believe that no such algorithm exists.
Greedy algorithm: sequen al coloring: 1. Order the ver ces in nonincreasing order of their degrees. 2. Scan the list to color each vertex in the first available color, i.e., the first color not used for coloring any vertex adjacent to it.
Not always op mal! (order ma ers)
h p://upload.wikimedia.org/wikipedia/commons/0/00/Greedy_colourings.svgVillanova CSC 1300 - Dr Papalaskari 25
Example: Index Registers
source: h p://www.lighterra.com/papers/graphcoloring/
Villanova CSC 1300 - Dr Papalaskari 26 Another Applica on of vertex coloring: Traffic lights
• see also example 13.3.9 & Figure 13.12
Villanova CSC 1300 - Dr Papalaskari 29 Another Applica on of vertex coloring: Traffic lights
• see also example 13.3.9 & Figure 13.12
Villanova CSC 1300 - Dr Papalaskari 30