networkx.antichains

networkx.antichains(G)[source]

Generates antichains from a DAG.

An antichain is a subset of a partially ordered set such that any two elements in the subset are incomparable.

Parameters:

G : NetworkX DiGraph

Graph

Returns:

antichain : generator object

Raises:

NetworkXNotImplemented

If G is not directed

NetworkXUnfeasible

If G contains a cycle

Notes

This function was originally developed by Peter Jipsen and Franco Saliola for the SAGE project. It’s included in NetworkX with permission from the authors. Original SAGE code at:

https://sage.informatik.uni-goettingen.de/src/combinat/posets/hasse_diagram.py

References

[R831]Free Lattices, by R. Freese, J. Jezek and J. B. Nation, AMS, Vol 42, 1995, p. 226.