G Graph Coloring - Villanova

Post on 28-Nov-2021

4 views 0 download

Transcript of 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)=

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

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.

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

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

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