networkx 2.8.2 Pypi GitHub Homepage
Other Docs
BackRef
barbell_graph(m1, m2, create_using=None)

For $m1 > 1$ and $m2 >= 0$.

Two identical complete graphs $K_{m1}$ form the left and right bells, and are connected by a path $P_{m2}$.

The :None:None:`2*m1+m2` nodes are numbered

:None:None:`0, ..., m1-1` for the left barbell, :None:None:`m1, ..., m1+m2-1` for the path, and :None:None:`m1+m2, ..., 2*m1+m2-1` for the right barbell.

The 3 subgraphs are joined via the edges :None:None:`(m1-1, m1)` and :None:None:`(m1+m2-1, m1+m2)`. If :None:None:`m2=0`, this is merely two complete graphs joined together.

This graph is an extremal example in David Aldous and Jim Fill's e-text on Random Walks on Graphs.

Returns the Barbell Graph: two complete graphs connected by a path.

Examples

See :

Back References

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

networkx.algorithms.components.biconnected.biconnected_component_edges networkx.algorithms.bridges.bridges networkx.algorithms.connectivity.edge_augmentation.is_locally_k_edge_connected networkx.algorithms.components.biconnected.articulation_points networkx.algorithms.community.quality.modularity networkx.algorithms.connectivity.edge_augmentation.is_k_edge_connected networkx.algorithms.connectivity.edge_kcomponents.bridge_components

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/generators/classic.py#146
type: <class 'function'>
Commit: