Mathematics for Computer Science Mathematics for Computer Science MIT 6.042J/18.062J MIT 6.042J/18.062J Team Problem 1 Copyright © Albert R. Meyer, 2005. October 5, 2005 Lec 5W.1 Airline Gate Allocation October 5, 2005 Lec 5W.2 122 145 Flight 67 Numbers 257 306 99 Lec 5W.3 October 5, 2005 Copyright © Albert R. Meyer, 2005. Lec 5W.4 Model as a Graph 257 145 306 122 145 67 306 99 Copyright © Albert R. Meyer, 2005. October 5, 2005 time Model as a Graph Needs gate at same time Copyright © Albert R. Meyer, 2005. Airline Schedule Given a set of airline flights needing gates at overlapping times, how many different gates do I need in order to accommodate them? Copyright © Albert R. Meyer, 2005. Graph Coloring 99 October 5, 2005 Lec 5W.5 Copyright © Albert R. Meyer, 2005. October 5, 2005 Lec 5W.6 1 Color vertices Coloring the Vertices so that adjacent vertices have different colors. 257 October 5, 2005 4 gates Lec 5W.7 Better: 3 Colors 257 145 assign 67 Gates: 306 # colors = # gates needed Copyright © Albert R. Meyer, 2005. 122 Copyright © Albert R. Meyer, 2005. 257, 67 122,145 99 306 99 October 5, 2005 Lec 5W.8 Final Exam Time Slots 122 Two subjects conflict if a student is taking both. Assign conflicting subjects to different time slots, keeping exam period short. 145 67 306 99 so 3 airline gates will do Copyright © Albert R. Meyer, 2005. October 5, 2005 Lec 5W.9 Model as a Graph 6.042 Copyright © Albert R. Meyer, 2005. October 5, 2005 Lec 5W.10 More Conflicting Allocation Problems 8.02 3.091 4 time slots (best possible) Copyright © Albert R. Meyer, 2005. 18.02 assign times: 6.001 October 5, 2005 M 9am M 1pm T 9am T 1pm Lec 5W.11 • # 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? Copyright © Albert R. Meyer, 2005. October 5, 2005 Lec 5W.12 2 Map Coloring Copyright © Albert R. Meyer, 2005. Countries are the Vertices October 5, 2005 Lec 5W.13 Four Color Theorem October 5, 2005 Lec 5W.15 Trees are 2-colorable χ(G) = Chromatic Number of G := minimum #colors for G Copyright © Albert R. Meyer, 2005. Lec 5W.16 χ (Ceven ) = 2 Pick any vertex as “root.” If (unique) path from root to w is even length: w odd length: w October 5, 2005 October 5, 2005 Simple Cycles root Copyright © Albert R. Meyer, 2005. Lec 5W.14 Chromatic Number Any planar map is 4-colorable. False proof published 1850’s (was correct for 5 colors). Proof with computer calculations: 1970’s. Much improved: 1990’s Copyright © Albert R. Meyer, 2005. October 5, 2005 Copyright © Albert R. Meyer, 2005. χ (Codd ) = 3 Lec 5W.17 Copyright © Albert R. Meyer, 2005. October 5, 2005 Lec 5W.18 3 The Wheel Wn Complete Graph K5 W5 χ (Kn ) = n Copyright © Albert R. Meyer, 2005. October 5, 2005 χ (Wodd ) = 4 Lec 5W.19 If deg(v) ≤ k for all vertices v of G, then χ (G ) ≤ k +1 A simple recursive coloring procedure achieves this. October 5, 2005 October 5, 2005 Lec 5W.20 Arbitrary Graphs Bounded Degree Copyright © Albert R. Meyer, 2005. Copyright © Albert R. Meyer, 2005. χ (Weven ) = 3 Lec 5W.21 2-colorable? --easy to check 3-colorable? --hard to check (even if planar) χ (G ) ? --harder still Copyright © Albert R. Meyer, 2005. October 5, 2005 Lec 5W.25 Team Problems Problems 2 & 3 Copyright © Albert R. Meyer, 2005. October 5, 2005 Lec 5W.26 4