词条 | 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 {{mvar|W}}. When {{math|1=W = 2}}, it uses the minimum possible number of distinct levels,[1] and in general it uses at most {{math|2 − 2/W}} times as many levels as necessary.[2][3] Problem statement and applicationsIn the version of the job shop scheduling problem solved by the Coffman–Graham algorithm, one is given a set of {{mvar|n}} jobs {{math|J1, J2, ..., Jn}}, together with a system of precedence constraints {{math|Ji < Jj}} requiring that job {{math|Ji}} be completed before job {{math|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 {{mvar|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 {{mvar|W}} elements per level), respecting the precedence constraints. This application was the original motivation for Coffman and Graham to develop their algorithm.[1][2] In the layered graph drawing framework outlined by {{harvtxt|Sugiyama|Tagawa|Toda|1981}}[3] the input is a directed graph, and a drawing of a graph is constructed in several stages:[7][4]
In this framework, the {{mvar|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 {{mvar|y}}-coordinate), which is the problem solved by the Coffman–Graham algorithm.[5] 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.[6] 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 {{mvar|W}}. The desired output is an assignment of integer level numbers to the elements of the partially ordered set such that, if {{math|x < y}} is an ordered pair of related elements of the partial order, the number assigned to {{mvar|x}} is smaller than the number assigned to {{mvar|y}}, such that at most {{mvar|W}} elements are assigned the same number as each other, and minimizing the difference between the smallest and the largest assigned numbers. The algorithmThe Coffman–Graham algorithm performs the following steps.[5]
AnalysisAs {{harvtxt|Coffman|Graham|1972}} originally proved, their algorithm computes an optimal assignment for {{math|1=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.[7] For {{math|W > 2}}, the Coffman–Graham algorithm uses a number of levels (or computes a schedule with a makespan) that is within a factor of {{math|2 − 2/W}} of optimal.[8][9] For instance, for {{math|1=W = 3}}, this means that it uses at most {{math|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 {{mvar|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] {{harvtxt|Coffman|Graham|1972}} and {{harvtxt|Lenstra|Rinnooy Kan|1978}}[12] state the time complexity of the Coffman–Graham algorithm, on an {{mvar|n}}-element partial order, to be {{math|O(n2)}}. However, this analysis omits the time for constructing the transitive reduction, which is not known to be possible within this bound. {{harvtxt|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 {{harvtxt|Gabow|Tarjan|1985}}, this stage also takes linear time.[14]References1. ^1 2 {{citation | last1 = Coffman | first1 = E. G., Jr. | author1-link = Edward G. Coffman, Jr. | last2 = Graham | first2 = R. L. | author2-link = Ronald Graham | mr = 0334913 | journal = Acta Informatica | pages = 200–213 | title = Optimal scheduling for two-processor systems | url = http://www.math.ucsd.edu/~ronspubs/72_04_two_processors.pdf | volume = 1 | year = 1972 | doi=10.1007/bf00288685}}. {{DEFAULTSORT:Coffman-Graham algorithm}}2. ^{{citation|contribution=Some basic scheduling algorithms|first=Joseph Y.-T.|last=Leung|title=Handbook of Scheduling: Algorithms, Models, and Performance Analysis|publisher=CRC Press|year=2004|isbn=978-1-58488-397-5}}. 3. ^{{citation|first1=Kozo|last1=Sugiyama|first2=Shôjirô|last2=Tagawa|first3=Mitsuhiko|last3=Toda|title=Methods for visual understanding of hierarchical system structures|journal=IEEE Transactions on Systems, Man, and Cybernetics|volume=SMC-11|issue=2|pages=109–125|year=1981|mr=0611436|doi=10.1109/TSMC.1981.4308636}}. 4. ^{{citation|contribution=Layered drawings of digraphs|first1=Oliver|last1=Bastert|first2=Christian|last2=Matuszewski|title=Drawing Graphs: Methods and Models|editor1-first=Michael|editor1-last=Kaufmann|editor2-first=Dorothea|editor2-last=Wagner|editor2-link=Dorothea Wagner|publisher=Springer-Verlag|series=Lecture Notes in Computer Science|volume=2025|year=2001|pages=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. 5. ^1 2 {{citation|contribution=Chapter 9: Layered drawings of digraphs|title=Graph Drawing: Algorithms for the Visualization of Graphs|first1=Giuseppe|last1=di Battista|first2=Peter|last2=Eades|author2-link=Peter Eades|first3=Roberto|last3=Tamassia|author3-link=Roberto Tamassia|first4=Ioannis G.|last4=Tollis|publisher=Prentice Hall|year=1999|pages=265–302}}. 6. ^{{citation | last1 = Healy | first1 = Patrick | last2 = Nikolov | first2 = Nikola S. | contribution = How to layer a directed acyclic graph | doi = 10.1007/3-540-45848-4_2 | mr = 1962416 | pages = 16–30 | publisher = Springer-Verlag | series = Lecture Notes in Computer Science | title = Graph Drawing: 9th International Symposium, GD 2001 Vienna, Austria, September 23–26, 2001, Revised Papers | volume = 2265 | year = 2002}}. 7. ^{{citation | last1 = Muntz | first1 = R. R. | last2 = Coffman | first2 = E. G. | author2-link = Edward G. Coffman, Jr. | doi = 10.1109/T-C.1969.222573 | journal = IEEE Transactions on Computers | pages = 1014–1020 | title = Optimal preemptive scheduling on two-processor systems | volume = 18 | year = 1969}}. 8. ^1 {{citation | last1 = Lam | first1 = Shui | last2 = Sethi | first2 = Ravi | author2-link = Ravi Sethi | doi = 10.1137/0206037 | mr = 0496614 | issue = 3 | journal = SIAM Journal on Computing | pages = 518–536 | title = Worst case analysis of two scheduling algorithms | volume = 6 | year = 1977}}. 9. ^1 {{citation | last1 = Braschi | first1 = Bertrand | last2 = Trystram | first2 = Denis | doi = 10.1137/S0097539790181889 | mr = 1274650 | issue = 3 | journal = SIAM Journal on Computing | pages = 662–669 | title = A new insight into the Coffman–Graham algorithm | volume = 23 | year = 1994}}. 10. ^{{citation | last1 = Chardon | first1 = Marc | last2 = Moukrim | first2 = Aziz | doi = 10.1137/S0895480101394999 | mr = 2178187 | issue = 1 | journal = SIAM Journal on Discrete Mathematics | pages = 109–121 | title = The Coffman-Graham algorithm optimally solves UET task systems with overinterval orders | volume = 19 | year = 2005}}. 11. ^{{citation | last1 = Coffman | first1 = E. G., Jr. | author1-link = Edward G. Coffman, Jr. | last2 = Sethuraman | first2 = J. | last3 = Timkovsky | first3 = V. G. | doi = 10.1007/s00236-003-0119-6 | mr = 1996238 | issue = 8 | journal = Acta Informatica | pages = 597–612 | title = Ideal preemptive schedules on two processors | volume = 39 | year = 2003}}. 12. ^{{citation | last1 = Lenstra | first1 = J. K. | author1-link = Jan Karel Lenstra | last2 = Rinnooy Kan | first2 = A. H. G. | author2-link = Alexander Rinnooy Kan | jstor = 169889 | mr = 0462553 | issue = 1 | journal = Operations Research | pages = 22–35 | title = Complexity of scheduling under precedence constraints | volume = 26 | year = 1978 | doi=10.1287/opre.26.1.22}}. 13. ^{{citation | last = Sethi | first = Ravi | authorlink = Ravi Sethi | doi = 10.1137/0205005 | mr = 0398156 | issue = 1 | journal = SIAM Journal on Computing | pages = 73–82 | title = Scheduling graphs on two processors | volume = 5 | year = 1976}}. 14. ^{{citation | last1 = Gabow | first1 = Harold N. | last2 = Tarjan | first2 = Robert Endre | author2-link = Robert Tarjan | doi = 10.1016/0022-0000(85)90014-5 | mr = 801823 | issue = 2 | journal = Journal of Computer and System Sciences | pages = 209–221 | title = A linear-time algorithm for a special case of disjoint set union | volume = 30 | year = 1985}}. 3 : Graph drawing|Optimization algorithms and methods|Scheduling algorithms |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。