Returns the layer of each vertex in an onion decomposition of the graph.
The onion decomposition refines the k-core decomposition by providing information on the internal organization of each k-shell. It is usually used alongside the
G (NetworkX graph) – A simple graph without self loops or parallel edges
od_layers – A dictionary keyed by vertex to the onion layer. The layers are contiguous integers starting at 1.
- Return type
NetworkXError – The onion decomposition is not implemented for graphs with self loops or parallel edges or for directed graphs.
Not implemented for graphs with parallel edges or self loops.
Not implemented for directed graphs.
Multi-scale structure and topological anomaly detection via a new network statistic: The onion decomposition L. Hébert-Dufresne, J. A. Grochow, and A. Allard Scientific Reports 6, 31708 (2016) http://doi.org/10.1038/srep31708
Percolation and the effective structure of complex networks A. Allard and L. Hébert-Dufresne Physical Review X 9, 011023 (2019) http://doi.org/10.1103/PhysRevX.9.011023