aryagraph.algorithms.dag.minimum_chain_partition#

aryagraph.algorithms.dag.minimum_chain_partition(g: Graph) → list[list[Hashable]][source]#

Fewest chains covering every node of a DAG exactly once (Dilworth decomposition).

Each chain lists nodes in topological order; consecutive nodes are comparable (a path joins them) but need not be adjacent. There are dag_width() chains, ordered by their first node’s graph position.