190 likes | 539 Views
Chapter 5. Coloring of Graphs. 3. 1. 3. 1. 1. 1. 2. 2. 4. 4. Map Region Coloring. Coloring the regions of a map with different colors on regions with common boundaries . Vertex coloring 5.1.1.
E N D
Chapter 5 Coloring of Graphs Ch.5. Coloring of Graphs
3 1 3 1 1 1 2 2 4 4 Map Region Coloring • Coloring the regions of a map with different colors on regions with common boundaries Ch.5. Coloring of Graphs
Vertex coloring 5.1.1 • Ak-coloringof a graph Gis a labeling f: V(G) → S, where |S| = k (often we use S = [k]). The labels are colors; the vertices of one color form a color class. • Ak-coloring isproperif adjacent vertices have different labels. • A graph is k-colorableif it has a proper k-coloring. Thechromatic number(G) is the least ksuch that Gisk-colorable. Ch.5. Coloring of Graphs
k-chromatic 5.1.4 • A graph Gisk-chromaticif(G) =k. • A proper k-coloring of a k-chromatic graph is an optimal coloring. • If(H) < (G) = kfor every propersubgraphHofG, thenGiscolor-criticalork-critical. Ch.5. Coloring of Graphs
Clique number 5.1.6 • Theclique numberof a graph G, writtenω(G), is the maximum size of a set of pairwise adjacent vertices (clique) inG. Ch.5. Coloring of Graphs
Proposition 5.1.7 For every graph G, (G) ≥ ω(G) and χ(G) ≥ n(G)/α(G). • Proof: The first bound holds because vertices of a clique require distinct colors. The second bound holds because each color class is an independent set and thus has at most α(G) vertices. • (G) : chromatic number • ω(G) : clique number • α(G): independence number Ch.5. Coloring of Graphs
Ks C5 Example 5.1.8. • (G) may exceed ω(G). Forr≥ 2, let G = C2r+1∨ Ks (the join of C2r+1and Ks –see Definition 3.3.6). SinceC2r+1has no triangle, ω(G) = s+2. • Properly coloring the induced cycle requires at least three colors. Thes-clique needsscolors. Since every vertex of the induced cycle is adjacent to every vertex of the clique, these scolors must differ from the first three, and (G) ≥s+3. We conclude that (G) > ω(G). Ch.5. Coloring of Graphs
Greedy Coloring Algorithm • The greedy coloring relative to a vertex ordering v1,…,vnofV(G) is obtained by coloring vertices in the orderv1,…..,vn, assigning to vithe smallest indexed color not already used on its lower-indexed neighbors. Ch.5. Coloring of Graphs
Graph Theory Example of Greedy Coloring Algorithm Index 3 2 4 5 1 Coloring Sequence 3 5 1 4 2 9 Ch.5. Coloring of Graphs
Proposition: (G) (G) + 1 • Proof: In a vertex ordering, each vertex has at most (G) earlier neighbors, so the greedy coloring cannot be forced to use more than (G) + 1 colors. This proves constructively that (G) ≤ (G) + 1. Ch.5. Coloring of Graphs
Example: Register allocation and interval graphs 15.1.15 • Register allocation • A computer program stores the values of its variables in registers. • If two variables are never used simultaneously, then we can allocate them to the same register. • For each variable, we compute the first and last time when it is used. A variable is active during the interval between these times. Ch.5. Coloring of Graphs
Graph Theory Example: Register allocation and interval graphs 2 5.1.15 Interval graph We define a graph whose vertices are the variables. Two vertices are adjacent if they are active at a common time. The number of registers needed is the chromatic number of this graph. The time when a variable is active is an interval, so we obtain a special type of representation for the graph. 12 Ch.5. Coloring of Graphs
Graph Theory Interval Representation and interval graphscontinue An interval representation of a graph is a family of intervals assigned to the vertices so that vertices are adjacent if and only if the corresponding interval intersect. A graph having such a representation is an interval graph. A A B B C C Interval graph Interval representation 13 Ch.5. Coloring of Graphs
Example: Register allocation and interval graphscontinue • For the vertex ordering a, b, c, d, e, f, g, hof the interval graph below, greedy coloring assigns 1, 2, 1, 3, 2, 1, 2, 3, respectively, which is optimal. Greedy colorings relative to orderings startinga , d, … use four colors. 3 4 2 5 1 e h d c g e b g d f f c a a b h Ch.5. Coloring of Graphs
Proposition 5.1.16. If G is an interval graph, then(G) =ω(G) Proof: • Order the vertices according to the left endpoints of the intervals in an interval representation. • Apply greedy coloring, and suppose that xreceivesk, the maximum color assigned. • Sincexdoes not receive a smaller color, the left endpointaof its interval belongs also to intervals that already have colors 1 through k-1. Ch.5. Coloring of Graphs
Proposition 5.1.16. If G is an interval graph, then(G) =ω(G) Proof: • These intervals all share the point a, so we have a k-clique consisting ofxand neighbors of xwith colors 1 throughk-1. • Henceω(G) ≥ k≥ (G). Since(G) ≥ ω(G) always, this coloring is optimal. ■ Ch.5. Coloring of Graphs