CSC 1300 – Discrete Structures Villanova University

Villanova CSC 1300 - Dr Papalaskari 1 Major Themes • coloring • Chromac number χ(G) • Map coloring • • Applicaons

Villanova CSC 1300 - Dr Papalaskari 2 Vertex Colorings Adjacent verces cannot have the same color

Chromac number χ(G) = least number of colors needed to color the verces of a graph so that no two adjacent verces are assigned the same color?

Source: “Discrete Mathemacs” by Chartrand & Zhang, 2011, Waveland Press. 4 What is the least number of colors needed for the verces of this graph so that no two adjacent verces have the same color? χ(G) =

Source: “Discrete Mathemacs 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

hp://www.printco.com/pages/State%20Map%20Requirements/USA-colored-12-x-8.gif

hp://people.math.gatech.edu/~thomas/FC/usa.gif

Villanova CSC 1300 - Dr Papalaskari 11

Every is 4-colorable

The proof of this theorem is one of the most famous and controversial proofs in mathemacs, because it relies on a . It was first presented in 1976. A more recent reformulaon can be found in this arcle:

Formal Proof – The Four Color Theorem, Georges Gonthier, Noces of the American Mathemacal Society, December 2008. hp://www.ams.org/noces/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 Mathemacs with Ducks” by Sara-Marie Belcastro, 2012, CRC Press, Fig 13.1. Villanova CSC 1300 - Dr Papalaskari 16 Example

Source: “Discrete Mathemacs with Ducks” by Sara-Marie Belcastro, 2012, CRC Press, Fig 13.1. Villanova CSC 1300 - Dr Papalaskari 17 Chromac Numbers of Some Graphs • χ(G) = 1 iff ...

• For Kn, the with n verces, χ(Kn) =

Corollary: If a graph has Kn as its subgraph, then χ(Kn)=

• For Cn, the cycle with n verces, χ(Cn) =

• For any biparte graph G, χ(G) =

• For any planar graph G, χ(G) ≤ 4 (Four Color Theorem)

Villanova CSC 1300 - Dr Papalaskari 18 Applicaons of Graph Coloring

• map coloring • scheduling – eg: Final exam scheduling • Frequency assignments for radio staons • Index register assignments in opmizaon • 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 Mathemacs with Ducks” by Sara-Marie Belcastro, 2012, CRC Press, p374. Villanova CSC 1300 - Dr Papalaskari 24 Compung the Chromac Number

There is no efficient algorithm for finding χ(G) for arbitrary graphs. Most computer sciensts believe that no such algorithm exists.

Greedy algorithm: sequenal coloring: 1. Order the verces 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 opmal! (order maers)

hp://upload.wikimedia.org/wikipedia/commons/0/00/Greedy_colourings.svgVillanova CSC 1300 - Dr Papalaskari 25

Example: Index Registers

source: hp://www.lighterra.com/papers/graphcoloring/

Villanova CSC 1300 - Dr Papalaskari 26 Another Applicaon of vertex coloring: Traffic lights

• see also example 13.3.9 & Figure 13.12

Villanova CSC 1300 - Dr Papalaskari 29 Another Applicaon of vertex coloring: Traffic lights

• see also example 13.3.9 & Figure 13.12

Villanova CSC 1300 - Dr Papalaskari 30