Sei sulla pagina 1di 7

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 coloring.1 Albert R Meyer, April 5, 2013 coloring.2

Airline Schedule Conflicts Among 3 Flights

Needs gate at same time


time 145
122
145
Flights 67
257 306
306
99 99

Albert R Meyer, April 5, 2013 coloring.3 Albert R Meyer, April 5, 2013 coloring.4

1
Model all Conflicts with a Graph Color the vertices

257 122 145 Color vertices so that adjacent


vertices have different colors.
min # distinct colors needed =
67 min # gates needed
306

99

Albert R Meyer, April 5, 2013 coloring.5 Albert R Meyer, April 5, 2013 coloring.6

Coloring the Vertices Better coloring

257 122 145 257 122 145

assign
gates:
67 67
306 257, 67
306
122,145
4 colors 99 99
306
3 colors 99
4 gates Albert R Meyer, April 5, 2013 coloring.7
3 gates Albert R Meyer, April 5, 2013 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 coloring.9 Albert R Meyer, April 5, 2013 coloring.10

Conflicting Allocation Problems Map Coloring

# 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 coloring.11 Albert R Meyer, April 5, 2013 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 coloring.13 Albert R Meyer, April 5, 2013 coloring.14

Chromatic Number
Simple Cycles

min #colors for G is


χ(Ceven) = 2
chromatic number

χ(G) χ(Codd) = 3

Albert R Meyer, April 5, 2013 coloring.15 Albert R Meyer, April 5, 2013 coloring.18

4
Complete Graph K5
The Wheel Wn

W5
χ(Wodd) = 4
χ(Kn) = n
χ(Weven) = 3
Albert R Meyer, April 5, 2013 coloring.19 Albert R Meyer, April 5, 2013 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.

very simple algorithm… ≤ k neighbors, so


k+1 colors always work

Albert R Meyer, April 5, 2013 coloring.21 Albert R Meyer, April 5, 2013 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 2015

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .

Potrebbero piacerti anche