scheduling, map coloring, and graph coloring · l25 4 graph coloring and scheduling one way to do...
TRANSCRIPT
L25 2
SchedulingviaGraphColoring:FinalExamExample
Supposewanttoschedulesome;inalexamsforCScourseswithfollowingcoursenumbers:
1007,3137,3157,3203,3261,4115,4118,4156Supposealsothattherearenostudentsincommontakingthefollowingpairsofcourses:
1007‐31371007‐3157,3137‐31571007‐32031007‐3261,3137‐3261,3203‐32611007‐4115,3137‐4115,3203‐4115,3261‐41151007‐4118,3137‐41181007‐4156,3137‐4156,3157‐4156Howmanyexamslotsarenecessarytoscheduleexams?
L25 3
GraphColoringandScheduling• Convertproblemintoagraphcoloringproblem.• Coursesarerepresentedbyvertices.• Twoverticesareconnectedwithanedgeifthe
correspondingcourseshaveastudentincommon.
1007
3137
3157
3203
4115
3261
4156
4118
L25 4
GraphColoringandScheduling
Onewaytodothisistoputedgesdownwherestudentsmutuallyexcluded…
1007
3137
3157
3203
4115
3261
4156
4118
L25 5
GraphColoringandScheduling
…andthencomputethecomplementarygraph:
1007
3137
3157
3203
4115
3261
4156
4118
L25 6
GraphColoringandScheduling
…andthencomputethecomplementarygraph:
1007
3137
3157
3203
4115
3261
4156
4118
L25 7
GraphColoringandScheduling
Redrawthegraphforconvenience:
1007
3137
3157
3203
4115
3261
4156 4118
L25 8
GraphColoringandScheduling
Thegraphisobviouslynot1‐colorablebecausethereexistedges.
1007
3137
3157
3203
4115
3261
4156 4118
L25 9
GraphColoringandScheduling
Thegraphisnot2‐colorablebecausethereexisttriangles.
1007
3137
3157
3203
4115
3261
4156 4118
L25 10
GraphColoringandScheduling
Isit3‐colorable?TrytocolorbyRed,Green,Blue.
1007
3137
3157
3203
4115
3261
4156 4118
L25 11
GraphColoringandScheduling
Pickatriangleandcolorthevertices3203‐Red,3157‐Blueand4118‐Green.
1007
3137
3157
3203
4115
3261
4156 4118
L25 14
GraphColoringandScheduling
3137and1007easytocolor–pickBlue.
1007
3137
3157
3203
4115
3261
4156 4118
L25 15
GraphColoringandScheduling
Thereforeweneed3examslots:
1007
3137
3157
3203
4115
3261
4156 4118
Slot1
Slot2
Slot3
BasicTheorems• HandshakingLemma:
• Inanygraph,thesumofthedegreesoftheverticesisequaltotwicethenumberofedges.
PlanarHandshakingTheorem
• Inanyplanargraph,thesumofthedegreesofthefacesisequaltotwicethenumberofedges.
TwoTheorems
• Twotheoremsareimportantinourapproachtothe4‐colorproblem.
• The;irstputsandupperboundtothenumberofedgesasimpleplanargraphwithVverticescanhave.
• Thesecondputsanupperboundonthedegreeofthevertexofsmallestdegree.
ReplaceV*andincidentedges.Sincewehave6colorsavailableandatmost5adjacentvertices,usethe
remainingcolorforV*.
The5ColorTheorem:Allconnectedsimpleplanargraphsare5colorable.Proofbyinductiononthenumberofvertices.
• BaseCase:Anyconnectedsimpleplanargraphwith5orfewerverticesis5‐colorable.
• InductionHypothesis:Assumeeveryconnectedsimpleplanargraphswithkverticesis5‐colorable.
• Proveforagraphwithk+1vertices.
• Removethisvertexandalledgesincidenttoit.• Bytheinductionhypothesistheremaininggraphwithkverticesis5‐colorable.
ReplaceV*andtheincidentedges.WecancolorV*onlyifitsadjacentverticesdonotuseall5colors.Thereforeassumeall5colorsarealreadyused.