The documentation for retworkx has migrated to:
These docs will no longer be updated.
- layers(dag, first_layer, /)¶
Return a list of layers
A layer is a subgraph whose nodes are disjoint, i.e., a layer has depth 1. The layers are constructed using a greedy algorithm.
graph (PyDiGraph) – The DAG to get the layers from
first_layer (list) – A list of node ids for the first layer. This will be the first layer in the output
A list of layers, each layer is a list of node data
- Return type
InvalidNode – If a node index in
first_layeris not in the graph