networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesYieldsBackRef
antichains(G, topo_order=None)

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

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://github.com/sagemath/sage/blob/master/src/sage/combinat/posets/hasse_diagram.py

Parameters

G : NetworkX DiGraph

A directed acyclic graph (DAG)

topo_order: list or tuple, optional :

A topological order for G (if None, the function will compute one)

Raises

NetworkXNotImplemented

If G is not directed

NetworkXUnfeasible

If G contains a cycle

Generates antichains from a directed acyclic graph (DAG).

Yields

antichain : list

a list of nodes in G representing an antichain

Examples

>>> DG = nx.DiGraph([(1, 2), (1, 3)])
... list(nx.antichains(DG)) [[], [3], [2], [2, 3], [1]]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.dag.antichains

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/dag.py#823
type: <class 'function'>
Commit: