Mathematics for Computer Science Flight Gates MIT 6.042J/18.062J flights need gates, but Simple Graphs: times overlap. Coloring how many gates needed? Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.1 coloring.2 Conflicts Among 3 Flights Airline Schedule Needs gate at same time time 145 122 145 Flights 67 306 257 306 99 99 Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.3 coloring.4 1
Model all Conflicts with a Graph Color the vertices 257 122 Color vertices so that adjacent 145 vertices have different colors. min # distinct colors needed = 67 min # gates needed 306 99 Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.5 coloring.6 Coloring the Vertices Better coloring 257 122 257 122 145 145 assign gates: 67 67 306 306 257, 67 122,145 4 colors 3 colors 99 99 99 306 4 gates 3 gates Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.7 coloring.8 2
Final Exams Model as a Graph 8.02 subjects conflict if student takes both, so 6.042 18.02 need different time slots. assign times: how short an exam period? 3.091 M 9am 4 time slots M 1pm (best possible) 6.001 T 9am T 1pm Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.9 coloring.10 Map Coloring Conflicting Allocation Problems # separate habitats to house different species of animals, some incompatible with others? # different frequencies for radio stations that interfere with each other? # different colors to color a map? Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.11 coloring.12 3
Countries are the Vertices Planar Four Coloring any planar map is 4-colorable. 1850’s: false proof published (was correct for 5 colors). 1970’s: proof with computer 1990’s: much improved Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.13 coloring.14 Chromatic Number Simple Cycles min #colors for G is χ (C even ) = 2 chromatic number χ (G) χ (C odd ) = 3 Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.15 coloring.18 4
Complete Graph K 5 The Wheel W n W 5 χ (W odd ) = 4 χ (K n ) = n χ (W even ) = 3 Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.19 coloring.20 Bounded Degree “Greedy” Coloring all degrees ≤ k, implies …color vertices in any order. next vertex gets a color χ (G) ≤ k+1 different from its neighbors. ≤ k neighbors, so very simple algorithm… k+1 colors always work Albert R Meyer, April 5, 2013 Albert R Meyer, April 5, 2013 coloring.21 coloring.22 5
coloring arbitrary graphs 2-colorable? --easy to check 3-colorable? --hard to check (even if planar) find χ (G)? --theoretically no harder than 3-color, but harder in practice Albert R Meyer, April 5, 2013 coloring.25 6
MIT OpenCourseWare http://ocw.mit.edu 6.042J / 18.062J Mathematics for Computer Science Spring 20 15 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
Recommend
More recommend