Coffman–Graham algorithm

Coffman–Graham algorithm

In job shop scheduling and graph drawing, the Coffman–Graham algorithm is an algorithm, named after Edward G. Coffman, Jr. and Ronald Graham, for arranging the elements of a partially ordered set into a sequence of levels. The algorithm chooses an arrangement such that an element that comes after another in the order is assigned to a lower level, and such that each level has a number of elements that does not exceed a fixed width bound W. When W = 2, it uses the minimum possible number of distinct levels,[1] and in general it uses at most 2 − 2/W times as many levels as necessary.[2][3]

Contents

Problem statement and applications

In the version of the job shop scheduling problem solved by the Coffman–Graham algorithm, one is given a set of n jobs J1, J2, ..., Jn, together with a system of precedence constraints Ji < Jj requiring that job Ji be completed before job Jj begins. Each job is assumed to take unit time to complete. The scheduling task is to assign each of these jobs to time slots on a system of W identical processors, minimizing the makespan of the assignment (the time from the beginning of the first job until the completion of the final job). Abstractly, the precedence constraints define a partial order on the jobs, so the problem can be rephrased as one of assigning the elements of this partial order to levels (time slots) in such a way that each time slot has at most as many jobs as processors (at most W elements per level), respecting the precendence constraints. This application was the original motivation for Coffman and Graham to develop their algorithm.[1][4]

In the layered graph drawing framework outlined by Sugiyama, Tagawa & Toda (1981)[5] and implemented in systems such as Microsoft Automatic Graph Layout, the input is a directed graph, and a drawing of a graph is constructed in several stages:[6][7]

  1. A feedback arc set is chosen, and the edges of this set reversed, in order to convert the input into a directed acyclic graph.
  2. The vertices of the graph are given integer y-coordinates in such a way that, for each edge, the starting vertex of the edge has a higher coordinate than the ending vertex, with at most W vertices sharing the same y-coordinate.
  3. Dummy vertices are introduced within each edge so that the subdivided edges all connect pairs of vertices that are in adjacent levels of the drawing.
  4. Within each group of vertices with the same y-coordinate, the vertices are permuted in order to minimize the number of crossings in the resulting drawing, and the vertices are assigned x-coordinates consistently with this permutation.
  5. The vertices and edges of the graph are drawn with the coordinates assigned to them.

In this framework, the y-coordinate assignment again involves grouping elements of a partially ordered set (the vertices of the graph, with the reachability ordering on the vertex set) into layers (sets of vertices with the same y-coordinate), which is the problem solved by the Coffman–Graham algorithm.[6] Although there exist alternative approaches than the Coffman–Graham algorithm to the layering step, these alternatives in general are either not able to incorporate a bound on the maximum width of a level or rely on complex integer programming procedures.[8]

More abstractly, both of these problems can be formalized as a problem in which the input consists of a partially ordered set and an integer W. The desired output is an assignment of integer level numbers to the elements of the partially ordered set such that, if x < y is an ordered pair of related elements of the partial order, the number assigned to x is smaller than the number assigned to y, such that at most W elements are assigned the same number as each other, and minimizing the difference between the smallest and the largest assigned numbers.

The algorithm

The Coffman–Graham algorithm performs the following steps.[6]

  1. Represent the partial order by its transitive reduction or covering relation, a directed acyclic graph G that has an edge from x to y whenever x < y and there does not exist any third element z of the partial order for which x < z < y. In the graph drawing applications of the Coffman–Graham algorithm, the resulting directed acyclic graph may not be the same as the graph being drawn, and in the scheduling applications it may not have an edge for every precedence constraint of the input: in both cases, the transitive reduction removes redundant edges that are not necessary for defining the partial order.
  2. Construct a topological ordering of G in which the vertices are ordered lexicographically by the set of positions of their incoming neighbors. To do so, add the vertices one at a time to the ordering, at each step choosing a vertex v to add such that the incoming neighbors of v are all already part of the partial ordering, and such that the most recently added incoming neighbor of v is earlier than the most recently added incoming neighbor of any other vertex that could be added in place of v. If two vertices have the same most recently added incoming neighbor, the algorithm breaks the tie in favor of the one whose second most recently added incoming neighbor is earlier, etc.
  3. Assign the vertices of G to levels in the reverse of the topological ordering constructed in the previous step. For each vertex v, add v to a level that is at least one step higher than the highest level of any outgoing neighbor of v, that does not already have W elements assigned to it, and that is as low as possible subject to these two constraints.

Analysis

As Coffman & Graham (1972) originally proved, their algorithm computes an optimal assignment for W = 2; that is, for scheduling problems with unit length jobs on two processors, or for layered graph drawing problems with at most two vertices per layer.[1] A closely related algorithm also finds the optimal solution for scheduling of jobs with varying lengths, allowing pre-emption of scheduled jobs, on two processors.[9] For W > 2, the Coffman–Graham algorithm uses a number of levels (or computes a schedule with a makespan) that is within a factor of 2 − 2/W of optimal.[2][3] For instance, for W = 3, this means that it uses at most 4/3 times as many levels as is optimal. When the partial order of precedence constraints is an interval order, or belongs to several related classes of partial orders, the Coffman–Graham algorithm finds a solution with the minimum number of levels regardless of its width bound.[10]

As well as finding schedules with small makespan, the Coffman–Graham algorithm (modified from the presentation here so that it topologically orders the reverse graph of G and places the vertices as early as possible rather than as late as possible) minimizes the total flow time of two-processor schedules, the sum of the completion times of the individual jobs. A related algorithm can be used to minimize the total flow time for a version of the problem in which preemption of jobs is allowed.[11]

Coffman & Graham (1972) and Lenstra & Rinnoy Kan (1978)[12] state the time complexity of the Coffman–Graham algorithm, on an n-element partial order, to be O(n2). However, this analysis omits the time for constructing the transitive reduction, which is not known to be possible within this bound. Sethi (1976) shows how to implement the topological ordering stage of the algorithm in linear time, based on the idea of partition refinement.[13] Sethi also shows how to implement the level assignment stage of the algorithm efficiently by using a disjoint-set data structure. In particular, with a version of this structure published later by Gabow & Tarjan (1985), this stage also takes linear time.[14]

References

  1. ^ a b c Coffman, E. G., Jr.; Graham, R. L. (1972), "Optimal scheduling for two-processor systems", Acta Informatica 1: 200–213, MR0334913, http://www.math.ucsd.edu/~ronspubs/72_04_two_processors.pdf .
  2. ^ a b Lam, Shui; Sethi, Ravi (1977), "Worst case analysis of two scheduling algorithms", SIAM Journal on Computing 6 (3): 518–536, doi:10.1137/0206037, MR0496614 .
  3. ^ a b Braschi, Bertrand; Trystram, Denis (1994), "A new insight into the Coffman–Graham algorithm", SIAM Journal on Computing 23 (3): 662–669, doi:10.1137/S0097539790181889, MR1274650 .
  4. ^ Leung, Joseph Y.-T. (2004), "Some basic scheduling algorithms", Handbook of Scheduling: Algorithms, Models, and Performance Analysis, CRC Press, ISBN 9781584883975 .
  5. ^ Sugiyama, Kozo; Tagawa, Shôjirô; Toda, Mitsuhiko (1981), "Methods for visual understanding of hierarchical system structures", IEEE Transactions on Systems, Man, and Cybernetics SMC-11 (2): 109–125, doi:10.1109/TSMC.1981.4308636, MR0611436 .
  6. ^ a b c di Battista, Giuseppe; Eades, Peter; Tamassia, Roberto; Tollis, Ioannis G. (1999), "Chapter 9: Layered drawings of digraphs", Graph Drawing: Algorithms for the Visualization of Graphs, Prentice Hall, pp. 265–302 .
  7. ^ Bastert, Oliver; Matuszewski, Christian (2001), "Layered drawings of digraphs", in Kaufmann, Michael; Wagner, Dorothea, Drawing Graphs: Methods and Models, Lecture Notes in Computer Science, 2025, Springer-Verlag, pp. 87–120, doi:10.1007/3-540-44969-8_5 . Bastert and Matuszewski also include a description of the Coffman–Graham algorithm; however, they omit the transitive reduction stage of the algorithm.
  8. ^ Healy, Patrick; Nikolov, Nikola S. (2002), "How to layer a directed acyclic graph", Graph Drawing: 9th International Symposium, GD 2001 Vienna, Austria, September 23–26, 2001, Revised Papers, Lecture Notes in Computer Science, 2265, Springer-Verlag, pp. 16–30, doi:10.1007/3-540-45848-4_2, MR1962416 .
  9. ^ Muntz, R. R.; Coffman, E. G. (1969), "Optimal preemptive scheduling on two-processor systems", IEEE Transactions on Computers 18: 1014–1020, doi:10.1109/T-C.1969.222573 .
  10. ^ Chardon, Marc; Moukrim, Aziz (2005), "The Coffman-Graham algorithm optimally solves UET task systems with overinterval orders", SIAM Journal on Discrete Mathematics 19 (1): 109–121, doi:10.1137/S0895480101394999, MR2178187 .
  11. ^ Coffman, E. G., Jr.; Sethuraman, J.; Timkovsky, V. G. (2003), "Ideal preemptive schedules on two processors", Acta Informatica 39 (8): 597–612, doi:10.1007/s00236-003-0119-6, MR1996238 .
  12. ^ Lenstra, J. K.; Rinnooy Kan, A. H. G. (1978), "Complexity of scheduling under precedence constraints", Operations Research 26 (1): 22–35, JSTOR 169889, MR0462553 .
  13. ^ Sethi, Ravi (1976), "Scheduling graphs on two processors", SIAM Journal on Computing 5 (1): 73–82, doi:10.1137/0205005, MR0398156 .
  14. ^ Gabow, Harold N.; Tarjan, Robert Endre (1985), "A linear-time algorithm for a special case of disjoint set union", Journal of Computer and System Sciences 30 (2): 209–221, doi:10.1016/0022-0000(85)90014-5, MR801823 .

Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Job shop scheduling — For other uses, see Scheduling. Job shop scheduling (or Job shop problem) is an optimization problem in computer science in which ideal jobs are assigned to resources at particular times. The most basic version is as follows: We are given n jobs… …   Wikipedia

  • Category:Optimization algorithms — An optimization algorithm is an algorithm for finding a value x such that f(x) is as small (or as large) as possible, for a given function f, possibly with some constraints on x. Here, x can be a scalar or vector of continuous or discrete values …   Wikipedia

  • Topological sorting — Dependency resolution redirects here. For other uses, see Dependency (disambiguation). In computer science, a topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that, for every edge uv, u comes… …   Wikipedia

  • Graph drawing — This article is about the general subject of graph drawing. For the annual research symposium, see International Symposium on Graph Drawing. Graphic representation of a minute fraction of the WWW, demonstrating hyperlinks. Graph drawing is an… …   Wikipedia

  • Problemas no resueltos de la informática — Los siguientes son algunos de los problemas no resueltos de las Ciencias de la Computación. Una solución de los problemas de esta lista tendría un impacto notable en el campo de estudio al que pertenecen. Contenido 1 Teoría de Complejidad… …   Wikipedia Español

  • Microsoft Automatic Graph Layout — (MSAGL) is a .NET library for automatic graph layout. It was created by Lev Nachmanson at Microsoft Research. Earlier versions carried the name GLEE (Graph Layout Execution Engine). Contents 1 Contents 2 Features 3 Availability and licensing …   Wikipedia

  • Temazepam — Systematic (IUPAC) name 7 Chloro 1,3 dihydro 3 hydroxy 1 methyl 5 phenyl 1,4 benzod …   Wikipedia

  • Cutting Stock Problem — Das eindimensionale Zuschnittproblem (engl. one dimensional cutting stock problem) ist ein schweres ganzzahliges lineares Optimierungsproblem mit dem Ziel, eindimensionale Teile in vorgegebenen Bedarfszahlen aus möglichst wenig Stücken Material… …   Deutsch Wikipedia

  • Eindimensionales Zuschnittproblem — Das eindimensionale Zuschnittproblem (engl. one dimensional cutting stock problem) ist ein schweres ganzzahliges lineares Optimierungsproblem mit dem Ziel, eindimensionale Teile in vorgegebenen Bedarfszahlen aus möglichst wenig Stücken Material… …   Deutsch Wikipedia

  • Zuschnittproblem — Das eindimensionale Zuschnittproblem (engl. one dimensional cutting stock problem) ist ein schweres ganzzahliges lineares Optimierungsproblem mit dem Ziel, eindimensionale Teile in vorgegebenen Bedarfszahlen aus möglichst wenig Stücken Material… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”