What does the largest antichain of a 'must finish before' order over tasks tell you about that workload?
answer
- count what cannot be ordered
- width against height
- the runnable set is an antichain
- fewest sequential tracks equals widest antichain
- Dilworth covers with chains, not antichains
basics
~20 sThe largest antichain is the order's width: the greatest number of tasks that are pairwise unordered, and therefore a ceiling on how many could ever be in flight together. Dilworth's theorem says that same number is the fewest chains needed to cover every task.
solid answer
~40 sA **chain** is a set of tasks that are pairwise ordered — they must run one after another. An **antichain** is a set that is pairwise unordered — no member must wait for any other. The size of the largest antichain is the order's **width**, and it bounds concurrency from the structure alone: at any instant the runnable tasks form an antichain, because a task whose predecessor is unfinished is not runnable and a finished predecessor has left the set. **Dilworth's theorem** adds the other half: for a finite order, the width equals the minimum number of chains needed to cover every element — the fewest strictly sequential tracks the work can be split into. The width is a structural ceiling, not a promise: durations, machines and readiness decide whether it is ever reached.
go deeper
Learn the two words: a chain is fully ordered, an antichain is fully unordered. The largest antichain is called the width of the order.
Explain why the runnable tasks at any instant form an antichain, and therefore why the width caps how many can be in flight at once.
Use both numbers to diagnose: small width means a dependency problem no extra capacity fixes, wide but underused means a scheduling or resource problem.
Treat width and height as inputs to whether to invest in capacity or in restructuring dependencies. Only the second moves a workload whose height dominates.
## Two shapes inside one order Order a set of tasks by `x <= y` meaning "`x` must finish before `y` starts, or is `y` itself". Two kinds of subset then matter: - a **chain** — every two members are comparable, so the whole subset is forced into one sequence; - an **antichain** — every two members are incomparable, so nothing inside it constrains anything else inside it. Note the strength of *every*. A set in which some pairs are unordered is not an antichain; one ordered pair anywhere disqualifies it. From these come two numbers: | Number | Definition | What it bounds | |---|---|---| | **Width** | size of the largest antichain | how many tasks can be unordered at once | | **Height** | number of tasks in the longest chain | how many must run strictly one after another | ## Why the width bounds simultaneity At any instant, call a task *runnable* if every task below it has finished and it has not finished itself. Any two runnable tasks must be incomparable: if `x < y` and `x` has not finished, `y` is not runnable; if `x` has finished, `x` is not runnable. So the runnable set is always an antichain, and no antichain can exceed the width. The ceiling follows from the order alone, with no reference to machines or durations. ## What Dilworth's theorem says, and in which direction **Dilworth's theorem**: in a finite partial order, the size of the largest antichain equals the minimum number of chains needed to cover every element. Both directions are worth reading: - **Easy direction.** Any antichain needs a distinct chain per member, since two members of one antichain can never share a chain. So chains needed `>=` largest antichain. - **Hard direction.** Exactly that many chains always suffice — the bound is achieved, never merely approached. The cover has a direct reading: it is the smallest number of strictly sequential tracks the whole workload can be divided into, where each track is internally ordered and requires no interleaving. Getting the direction wrong is the classic error here. Dilworth is about covering with **chains**; the dual statement — the minimum number of **antichains** needed to cover the order equals the length of the longest chain — is a different theorem, and it is the one that corresponds to level-by-level scheduling. ## What the width does not promise This is where the number gets misused. - **It is a ceiling, not an achievement.** Width 12 says no more than twelve tasks are ever mutually unordered. Whether twelve are ever simultaneously runnable depends on when their predecessors finish, which the order does not record. - **It ignores resources.** With three workers, a width of twelve buys nothing beyond three. - **It ignores duration.** An antichain of ten one-second tasks alongside one hour-long task gives a very different schedule from ten equal tasks, and both have the same width. - **Height is the complementary bound.** Even with unlimited workers, a chain of `h` tasks forces `h` sequential steps. Height bounds the time; width bounds the breadth. Neither substitutes for the other. ## Where the numbers actually help The useful question is not "how fast will this run" but "can restructuring help at all": 1. If height is large relative to the number of tasks, the order is nearly a chain, and adding workers cannot help — the dependencies must be broken instead. 2. If width is large but observed concurrency is small, the structure permits parallelism the runtime is not exploiting, and the problem lies in scheduling or resources. 3. If width is small and matches observed concurrency, the workload is running at its structural ceiling, and only changing the dependencies moves it. That is the value of the two numbers: they separate a dependency problem from a capacity problem before anyone buys more capacity.
- Does a width of eight mean eight tasks will actually run at once?No. Width is a structural ceiling on how many tasks are mutually unordered. Whether that many are simultaneously runnable depends on durations and on when predecessors finish, and available workers may cap it far lower. The order gives an upper bound and nothing more.
- What does the longest chain bound?The number of strictly sequential steps. A chain of `h` tasks must run one after another, so even with unlimited workers the workload takes at least `h` steps — and with unequal durations, at least the total duration along that chain. It is the bound adding capacity can never beat.
- Is a set of tasks with some unordered pairs an antichain?No. An antichain requires *every* pair to be incomparable. A single ordered pair means the set contains a constraint, so it cannot all be unordered, and using such a set as a concurrency estimate overstates the width.
saying these in an interview costs you the question
- Says the width predicts the speedup real machines will deliver
- Calls a set an antichain when only some of its pairs are unordered
- Confuses the longest chain with the largest antichain
- States that Dilworth's theorem counts the covering antichains
- Assumes the width is reached at some moment during execution