tadpole_graph#
- tadpole_graph(m, n, create_using=None)[source]#
Returns the (m,n)-tadpole graph;
C_m
connected toP_n
.This graph on m+n nodes connects a cycle of size
m
to a path of lengthn
. It looks like a tadpole. It is also called a kite graph or a dragon graph.(
Source code
,png
)- Parameters:
- m, nint or iterable container of nodes
If an integer, nodes are from
range(m)
andrange(m,m+n)
. If a container of nodes, those nodes appear in the graph. Warning:m
andn
are not checked for duplicates and if present the resulting graph may not be as desired.The nodes for
m
appear in the cycle graph \(C_m\) and the nodes forn
appear in the path \(P_n\).- create_usingNetworkX graph constructor, optional (default=nx.Graph)
Graph type to create. If graph instance, then cleared before populated.
- Returns:
- Networkx graph
A cycle of size
m
connected to a path of lengthn
.
- Raises:
- NetworkXError
If
m < 2
. The tadpole graph is undefined form<2
.
Notes
The 2 subgraphs are joined via an edge
(m-1, m)
. Ifn=0
, this is a cycle graph.m
and/orn
can be a container of nodes instead of an integer.
Additional backends implement this function
cugraph : GPU-accelerated backend.