AI Glossary / Graphs and symbolic AI / Advanced
Precedence constraints
Definition
Precedence constraints specify required temporal relationships between tasks. In finish-to-start form, one task must finish before another may begin. If task A starts at sA and lasts dA, requiring A before B gives sA + dA <= sB. The constraint permits B to start at A's finish time unless an additional waiting period is specified.
What it means
A report cannot be reviewed before it is prepared, and a package cannot be sealed before its contents are inserted. These dependencies constrain a schedule even when many workers are available. They do not necessarily place every task into a single sequence: independent work may overlap. Nor does a dependency alone say that two tasks use the same resource. A realistic schedule often combines precedence, resource capacity, calendars, durations and deadlines.
How it works
Give each task a start and finish, and specify which temporal relationship an edge represents. For a fixed-duration, uninterrupted task, finish equals start plus duration. A finish-to-start dependency with minimum lag L becomes finish(A) + L <= start(B). A lag can represent required waiting after work ends, rather than additional active work.
A directed graph can display these relationships. In an ordinary acyclic finish-to-start network, following predecessors helps compute earliest feasible starts when resource limits are ignored. This does not solve every scheduling problem: capacity restrictions can force additional delays. A solver can impose both temporal and resource constraints and optimize a stated objective. Feasibility means the requirements are satisfied; optimality additionally means the objective cannot be improved within the modeled alternatives.
Three practical examples
- A glossary production workflow requires drafting before factual review and review before release. Several drafts can proceed together if staffing permits, while each article retains its own review dependency.
- A manufacturing schedule requires machining before inspection and inspection before packaging. Two unrelated parts may still compete for the same machine, adding a resource restriction beyond those dependencies.
- A data-processing workflow requires extraction before transformation and transformation before loading. An independent reference-data update may run concurrently, unless a downstream task explicitly depends on both branches.
Think of it this way
Think of a recipe showing what must be ready before the next step. Chopping vegetables and heating water may happen together, but ingredients must be prepared before a step that uses them. The recipe's dependencies differ from the separate question of whether one cook can perform two active tasks simultaneously.
Worked example
Consider four mandatory tasks, measured in hours from time zero. A takes 3 hours, B takes 2, C takes 4 and D takes 1. C requires both A and B to finish, and D requires C to finish. All tasks are uninterrupted, available from time zero, and initially have separate resources.
Start A and B at 0. They finish at 3 and 2 respectively. C can start at max(3, 2) = 3 and finish at 7. D then runs from 7 to 8. The makespan is 8 hours.
This is optimal under these assumptions: the chain A, C, D requires 3 + 4 + 1 = 8 hours, so no feasible schedule can finish earlier. The constructed schedule achieves that bound. Listing B before A in a valid task ordering would not imply that their execution must be sequential.
Now suppose A and B require the same worker, who can perform only one task at a time. They need 5 hours of total work before C can start. One feasible schedule is A from 0 to 3, B from 3 to 5, C from 5 to 9 and D from 9 to 10. The minimum makespan becomes 10 hours. The original dependency graph has not changed, but resource capacity has.
In a separate variation, restore separate resources and require a two-hour wait after A finishes before C starts. Then C starts no earlier than max(3 + 2, 2) = 5, giving the same 10-hour completion time for a different reason. A itself still takes 3 hours. The lag restricts its successor; it does not silently change A's active duration.
Illustrative case study
In a fictional publishing project, a coordinator promises an eight-hour completion based on the first schedule. Staffing review reveals that A and B require the same specialist. The team explains the revised ten-hour bound using both the dependency chain and the specialist's workload.
Adding another specialist for one of those tasks can restore the eight-hour schedule, provided the original assumptions hold. It cannot reduce the eight-hour A-C-D chain merely by allowing more parallel work. The team also records any review waiting periods separately. This prevents a later manager from mistaking a mandatory delay for time that can be removed by assigning more workers.
Common misconceptions and mistakes
Precedence is not the same as priority: a high-priority task may still depend on unfinished work. A finish-to-start requirement does not mean the successor must start immediately, and a valid topological ordering does not provide actual start times.
Omitting a resource constraint can make an apparently feasible schedule impossible to execute. Conversely, imposing unnecessary precedence can prevent useful concurrency. Cycles also require inspection. In a mandatory finish-to-start cycle with positive total duration and nonnegative lags, adding the inequalities would require time to advance and return before itself; no feasible schedule exists under that model.
Business use
Precedence constraints help coordinate projects, manufacturing, content pipelines and automated workflows. Validate each dependency with the people who understand the work. State whether it concerns starts, finishes or a minimum delay. Separate mandatory relationships from preferred ordering, and record capacity and calendar assumptions explicitly. Compare a proposed completion date with both dependency-based bounds and resource limits. In the shared-worker example, a nine-hour deadline is infeasible under the stated requirements; relabeling it as urgent does not change the arithmetic.
People also ask
Can tasks without a dependency always overlap?
Only if resources and other constraints permit it.
Does 'before' require a gap?
Not in the stated inequality; equality permits immediate handoff. Add a lag when waiting is required.
Are all temporal constraints finish-to-start?
No. Scheduling systems can express relationships involving different start and finish endpoints.
Check your understanding
Why does C initially start at hour 3?
Answer: It must wait for both predecessors, including A's later finish.
What changes the makespan to 10 in the shared-worker case?
Answer: A and B can no longer overlap.
Does a two-hour lag make A a five-hour task?
Answer: No; A's work remains three hours, followed by a separate waiting requirement for C.
Related terms
- Scheduling
- Critical path
- Makespan
- Resource constraint
- dependency graph
- partial order
- topological ordering
- time lag
- constraint programming
Learn next
Combine the shared-worker restriction with the two-hour lag after A. Compare scheduling A first with scheduling B first, and explain why the order now affects completion time.
More in Graphs and symbolic AI
- Possibility theory - Possibility theory is a mathematical framework for representing uncertainty through degrees of possibility and necessity.
- Possible world - A possible world is a specified way a situation could be, used to evaluate whether statements are true or false.
- Potential field - A potential field is a scalar function over positions or robot configurations that guides motion through its slope.
- Precomputation - Precomputation means calculating information before the moment it is needed, then storing it for later reuse.
- Precondition - A precondition is a condition that must hold for an action to be applicable in a specified model.
- Precondition axioms - Precondition axioms are logical statements requiring an action's preconditions to hold whenever that action occurs in a planning model.
Sources
Google OR-Tools, job-shop scheduling: https://developers.google.com/optimization/scheduling/job_shop IBM Decision Optimization, scheduling tutorial: https://ibmdecisionoptimization.github.io/tutorials/html/Scheduling_Tutorial.html AIMA glossary, precedence constraints: https://github.com/aimacode/aima-glossary/blob/master/glossary.md
Previous: Pre-training Next: Precision