Unit 2-Lecture6: Directed Acyclic Graphs & Scheduling

来源:互联网 发布:唐七公子知乎 编辑:程序博客网 时间:2024/06/16 21:22

1 DAG

Definition: A directed acyclic graph (DAG) is a directed graph with no cycles.

2 Scheduling

2.1 Topological Sort

  • A topological sort of a finite DAG is a list of all the vertices such that each vertex v appears earlier in the list than every other vertex reachable from v.
  • For task dependencies, topological sorting provides a way to execute tasks one after another while respecting those dependencies.

2.2 minimal and minimum

An vertex v of a DAG, D, is minimum iff every other vertex is reachable from v. A vertex v is minimal iff v is not reachable from any other vertex.

  • These words come from the perspective that a vertex is “smaller” than any other vertex it connects to.
  • Every finite DAG has a topological sort.

2.3 Parallel Task Scheduling

  • Chain:
    Two vertices in a DAG are comparable when one of them is reachable from the other. A chain in a DAG is a set of vertices such that any two of them are comparable. A vertex in a chain that is reachable from all other vertices in the chain is called a maximum element of the chain. A finite chain is said to end at its maximum element.
  • A largest chain is also known as a critical path.
  • Antichain:
    An antichain in a DAG is a set of vertices such that no two elements in the set are comparable—no walk exists between any two different vertices in the set.
  • Schedule:
    A parallel schedule for a DAG, D, is a partition of V(D) into blocks A0, A1… such that when j < k, no vertex in Aj is reachable from any vertex in Ak. The block Ak is called the set of elements scheduled at step k, and the time of the schedule *is the number of blocks*. The **maximum number of elements **scheduled at any step is called the **number of processors **required by the schedule.
  • and the number of elements less than a in the chain is called the depth of a.

2.4 Dilworth’s Lemma

For all t > 0, every DAG with n vertices must have either a chain of size greater than t or an antichain of size at least n/t.


Reference

[1] Lehman E, Leighton F H, Meyer A R. Mathematics for Computer Science[J]. 2015.{}

0 0
原创粉丝点击