Dependencies as a Partial Order

A finite acyclic dependency graph can define a partial order by reachability, including the zero-length path at each node.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace an indirect requirement
  2. Check for a cycle before scheduling
  3. Account for implied precedence along a chain
  4. Check cycles before assuming a partial order

Trace an indirect requirement

If setup must precede build and build must precede publish, setup must precede publish even with no direct edge. Two independent jobs may be incomparable. Relation transitivity explains why the indirect requirement follows.

Check for a cycle before scheduling

If publish must precede setup too, reachability relates distinct tasks in both directions. Those prerequisites cannot all hold in a sequential schedule. Topological ordering constructs a valid execution order when the graph is acyclic.[1]

Account for implied precedence along a chain

If build A must precede package B and B must precede publish C, A also precedes C. A separate task D depending only on A can come before or after B. The dependency relation constrains a schedule without usually determining a unique schedule. See topological ordering.

Requirements: A→B, B→C, A→D
Valid: A,B,D,C
Also valid: A,D,B,C
Invalid: B,A,C,D

Check cycles before assuming a partial order

A cycle would make distinct tasks require each other to occur first. Use reachability for the implied precedence relation and include equality if using a reflexive order. A task schedule follows strict precedence for distinct linked tasks.

References

  1. Eric Lehman, F. Thomson Leighton and Albert R. Meyer, Mathematics for Computer Science ↩