G Graph Coloring - Villanova

6
CSC 1300 – Discrete Structures 17: Graph Coloring Dr Papalaskari 1 Graph Coloring CSC 1300 – Discrete Structures Villanova University Villanova CSC 1300 - Dr Papalaskari 1 Major Themes Vertex coloring ChromaFc number χ(G) Map coloring Greedy coloring algorithm ApplicaFons Villanova CSC 1300 - Dr Papalaskari 2 Vertex Colorings 4 Source: “Discrete MathemaFcs” by Chartrand & Zhang, 2011, Waveland Press. ChromaFc number χ(G) = least number of colors needed to color the verFces of a graph so that no two adjacent verFces are assigned the same color? Adjacent ver,ces cannot have the same color 5 Source: “Discrete MathemaFcs with Ducks” by Sara-Marie Belcastro, 2012, CRC Press, Fig 13.1. What is the least number of colors needed for the verFces of this graph so that no two adjacent verFces have the same color? χ(G) =

Transcript of G Graph Coloring - Villanova

Page 1: G Graph Coloring - Villanova

CSC1300–DiscreteStructures 17:GraphColoring

DrPapalaskari 1

GraphColoring

CSC1300–DiscreteStructuresVillanovaUniversity

VillanovaCSC1300-DrPapalaskari 1

MajorThemes•  Vertexcoloring•  ChromaFcnumberχ(G)•  Mapcoloring•  Greedycoloringalgorithm•  ApplicaFons

VillanovaCSC1300-DrPapalaskari 2

VertexColorings

4Source:“DiscreteMathemaFcs”byChartrand&Zhang,2011,WavelandPress.

ChromaFcnumberχ(G)=leastnumberofcolorsneededtocolortheverFcesofagraphsothatnotwoadjacentverFcesareassignedthesamecolor?

Adjacentver,cescannothavethesamecolor

5Source:“DiscreteMathemaFcswithDucks”bySara-MarieBelcastro,2012,CRCPress,Fig13.1.

WhatistheleastnumberofcolorsneededfortheverFcesofthisgraphsothatnotwoadjacentverFceshavethesamecolor?

χ(G)=

Page 2: G Graph Coloring - Villanova

CSC1300–DiscreteStructures 17:GraphColoring

DrPapalaskari 2

MapColoringRegionèvertexCommonborderèedge

G

B

AC D

E

F

IG H

VillanovaCSC1300-DrPapalaskari 8

MapColoring

VillanovaCSC1300-DrPapalaskari 9

Whatistheleastnumberofcolorsneededtocoloramap?

ColoringtheUSA

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

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

VillanovaCSC1300-DrPapalaskari 11

Fourcolortheorem

Every planar graph is 4-colorable

TheproofofthistheoremisoneofthemostfamousandcontroversialproofsinmathemaFcs,becauseitreliesonacomputerprogram.Itwasfirstpresentedin1976.AmorerecentreformulaFoncanbefoundinthisarFcle:FormalProof–TheFourColorTheorem,GeorgesGonthier,NoFcesoftheAmericanMathemaFcalSociety,December2008.hcp://www.ams.org/noFces/200811/tx081101382p.pdf

VillanovaCSC1300-DrPapalaskari 12

Page 3: G Graph Coloring - Villanova

CSC1300–DiscreteStructures 17:GraphColoring

DrPapalaskari 3

Doyoualwaysneedfourcolors?

Fourcolortheorem

Every planar graph is 4-colorable

VillanovaCSC1300-DrPapalaskari 13

Whataboutnon-planargraphs?

Fourcolortheorem

Every planar graph is 4-colorable

K5K3,3

VillanovaCSC1300-DrPapalaskari 14

Example

VillanovaCSC1300-DrPapalaskari 15

Example

VillanovaCSC1300-DrPapalaskari 16Source:“DiscreteMathemaFcswithDucks”bySara-MarieBelcastro,2012,CRCPress,Fig13.1.

Page 4: G Graph Coloring - Villanova

CSC1300–DiscreteStructures 17:GraphColoring

DrPapalaskari 4

Example

VillanovaCSC1300-DrPapalaskari 17Source:“DiscreteMathemaFcswithDucks”bySara-MarieBelcastro,2012,CRCPress,Fig13.1.

ChromaFcNumbersofSomeGraphs•  χ(G)=1iff...

•  ForKn,thecompletegraphwithnverFces,χ(Kn)=Corollary:IfagraphhasKnasitssubgraph,thenχ(Kn)=•  ForCn,thecyclewithnverFces,χ(Cn)=•  ForanybiparFtegraphG,χ(G)=•  ForanyplanargraphG,χ(G)≤4(FourColorTheorem)

VillanovaCSC1300-DrPapalaskari 18

•  mapcoloring

•  scheduling– eg:Finalexamscheduling

•  FrequencyassignmentsforradiostaFons•  IndexregisterassignmentsincompileropFmizaFon

•  Phasesfortrafficlights

Applica,onsofGraphColoring

VillanovaCSC1300-DrPapalaskari 19

Example:Scheduletheseexams,avoidingconflicts

VillanovaCSC1300-DrPapalaskari 20

CSC1700CSC2014

CSC4480

CSC2053

CSC2400

CSC1300CSC1052

Monday Tuesday Wednesday

Page 5: G Graph Coloring - Villanova

CSC1300–DiscreteStructures 17:GraphColoring

DrPapalaskari 5

Earlierexample–seenasschedulingconstraints

VillanovaCSC1300-DrPapalaskari 21

CSC1700

CSC2014 CSC4480CSC2053 CSC2400

CSC1300 CSC1052

RevisedExamSchedule:

VillanovaCSC1300-DrPapalaskari 23

CSC1700

CSC2014

CSC4480

CSC2053

CSC2400

CSC1300

CSC1052

Monday Tuesday Wednesday

??

Graphcoloringalgorithm?

VillanovaCSC1300-DrPapalaskari 24Source:“DiscreteMathemaFcswithDucks”bySara-MarieBelcastro,2012,CRCPress,p374.

Compu,ngtheChroma,cNumber

Thereisnoefficientalgorithmforfindingχ(G)forarbitrarygraphs.MostcomputerscienFstsbelievethatnosuchalgorithmexists.

Greedyalgorithm:sequen7alcoloring:1.  OrdertheverFcesinnonincreasingorderoftheirdegrees.2.  Scanthelisttocoloreachvertexinthefirstavailablecolor,i.e.,

thefirstcolornotusedforcoloringanyvertexadjacenttoit.

hcp://upload.wikimedia.org/wikipedia/commons/0/00/Greedy_colourings.svg

NotalwaysopFmal!(ordermacers)

VillanovaCSC1300-DrPapalaskari 25

Page 6: G Graph Coloring - Villanova

CSC1300–DiscreteStructures 17:GraphColoring

DrPapalaskari 6

Example:IndexRegisters

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

VillanovaCSC1300-DrPapalaskari 26

AnotherApplicaFonofvertexcoloring:Trafficlights

•  seealsoexample13.3.9&Figure13.12

VillanovaCSC1300-DrPapalaskari 29

AnotherApplicaFonofvertexcoloring:Trafficlights

•  seealsoexample13.3.9&Figure13.12

VillanovaCSC1300-DrPapalaskari 30