06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

“mcs” — 2017/3/3 — 11:21 — page 462 — #470<br />

462<br />

Chapter 12<br />

Simple Graphs<br />

Figure 12.13<br />

A 7-node star graph.<br />

12.6.3 Why coloring?<br />

One reason coloring problems frequently arise in practice is because scheduling<br />

conflicts are so common. For example, at the internet company Akamai, cofounded<br />

by Tom Leighton, a new version of software is deployed over each of its servers<br />

(200,000 servers in 2016) every few days. It would take more than twenty years to<br />

update all these the servers one at a time, so the deployment must be carried out<br />

<strong>for</strong> many servers simultaneouly. On the other hand, certain pairs of servers with<br />

common critical functions cannot be updated simultaneouly, since a server needs<br />

to be taken offline while being updated.<br />

This problem gets solved by making a 200,000-node conflict graph and coloring<br />

it with with a dozen or so colors—so only a dozen or so waves of installs are<br />

needed!<br />

Another example comes from the need to assign frequencies to radio stations. If<br />

two stations have an overlap in their broadcast area, they can’t be given the same<br />

frequency. Frequencies are precious and expensive, it is important to minimize the<br />

number handed out. This amounts to finding the minimum coloring <strong>for</strong> a graph<br />

whose vertices are the stations and whose edges connect stations with overlapping<br />

areas.<br />

Coloring also comes up in allocating registers <strong>for</strong> program variables. While a<br />

variable is in use, its value needs to be saved in a register. Registers can be reused<br />

<strong>for</strong> different variables, but two variables need different registers if they are referenced<br />

during overlapping intervals of program execution. So register allocation is<br />

the coloring problem <strong>for</strong> a graph whose vertices are the variables: vertices are adjacent<br />

if their intervals overlap, and the colors are registers. Once again, the goal is<br />

to minimize the number of colors needed to color the graph.<br />

Finally, there’s the famous map coloring problem stated in Proposition 1.1.4. The<br />

question is how many colors are needed to color a map so that adjacent territories<br />

get different colors? This is the same as the number of colors needed to color a<br />

graph that can be drawn in the plane without edges crossing. A proof that four

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!