Input a set r i1 in of n requestsactivities

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: run on the same CPU. How to run all jobs using as few CPUs as possible? I1 I4 I7 I2 0 1 2 3 4 5 14 15 I5 I8 I6 I3 c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 39 / 49 Scheduling All Intervals Another way to look at the problem: c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 40 / 49 Scheduling All Intervals Another way to look at the problem: Color the intervals in R by different colors. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 40 / 49 Scheduling All Intervals Another way to look at the problem: Color the intervals in R by different colors. The intervals with the same color do not overlap. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 40 / 49 Scheduling All Intervals Another way to look at the problem: Color the intervals in R by different colors. The intervals with the same color do not overlap. Using as few colors as possible. I4 I1 I7 I5 I2 I8 I6 I3 0 1 2 3 4 5 14 15 c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 40 / 49 Scheduling All Intervals Another way to look at the problem: Color the intervals in R by different colors. The intervals with the same color do not overlap. Using as few colors as possible. I4 I1 I7 I5 I2 I8 I6 I3 0 1 2 3 4 5 14 15 This problem is also known as Interval Graph Coloring Problem. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 40 / 49 Scheduling All Intervals c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 41 / 49 Scheduling All Intervals Graph Coloring Let G = (V, E) be an undirected graph. A vertex coloring of G is an assignment of colors to the vertices of G so that no two vertices with the same color are adjacent to each other in G. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 41 / 49 Scheduling All Intervals Graph Coloring Let G = (V, E) be an undirected graph. A vertex coloring of G is an assignment of colors to the vertices of G so that no two vertices with the same color are adjacent to each other in G. Equivalently, a vertex coloring of G is a partition of V into vertex subsets so that no two vertices in the same subset are adjacent to each other. I2 I1 I5 I4 I7 I8 I6 I3 c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 41 / 49 Scheduling All Intervals Graph Coloring Let G = (V, E) be an undirected graph. A vertex coloring of G is an assignment of colors to the vertices of G so that no two vertices with the same color are adjacent to each other in G. Equivalently, a vertex coloring of G is a partition of V into vertex subsets so that no two vertices in the same subset are adjacent to each other. I2 I1 I5 I4 I7 I8 I6 I3 A vertex coloring is also called just coloring of G. If G has a coloring with k colors, we say G is k-colorable. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 41 / 49 Scheduling All Intervals Graph Coloring Problem Input: An undirected graph G = (V, E) Output: Find a vertex coloring of G using as few colors as possible. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 42 / 49 Scheduling All Intervals Graph Coloring Problem Input: An undirected graph G = (V, E) Output: Find a vertex coloring of G using as few colors as possible. Chromatic Number (G) = the smallest k such that G is k-colorable c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 42 / 49 Scheduling All Intervals Graph Coloring Problem Input: An undirected graph G = (V, E) Output: Find a vertex coloring of G using as few colors as possible. Chromatic Number (G) = the smallest k such that G is k-colorable (G) = 1 iff G has no edges. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 42 / 49 Scheduling All Intervals Graph Coloring Problem Input: An undirected graph G = (V, E) Output: Find a vertex coloring of G using as few colors as possible. Chromatic Number (G) = the smallest k such that G is k-colorable (G) = 1 iff G has no edges. (G) = 2 iff G is a bipartite graph with at least 1 edge. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 42 / 49 Scheduling All Intervals Graph Coloring Problem Input: An undirected graph G = (V, E) Output: Find a vertex coloring of G using as few colors as possible. Chromatic Number (G) = the smallest k such that G is k-colorable (G) = 1 iff G has no edges. (G) = 2 iff G is a bipartite graph with at least 1 edge. Graph Coloring is a very hard problem. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 42 / 49 Scheduling All Intervals Graph Coloring Problem Input: An undirected graph G = (V, E) Output: Find a vertex coloring of G using as few colors as possible. Chromatic Number (G) = the smallest k such that G is k-colorable (G) = 1 iff G has no edges. (G) = 2 iff G is a bipartite graph with at least 1 edge. Graph Coloring is a very hard problem. The problem can be solved in poly-time only for special graphs. c Xin He (University at Buffalo) CSE 43...
View Full Document

Ask a homework question - tutors are online