cfpq_data.graphs.generators.labeled_cycle_graph#
- labeled_cycle_graph(n: int | Iterable[Any], label: str = 'a') MultiDiGraph[source]#
Returns a cycle graph \(C_n\) of cyclically connected nodes. With labeled edges.
\(C_n\) is a path with its two end-nodes connected.
- Parameters:
- nUnion[int, Iterable[Any]]
If n is an integer, nodes are from
range(n). If n is a container of nodes, those nodes appear in the graph.- label: str
Label that will be used to mark the edges of the graph.
- Returns:
- gMultiDiGraph
A cycle graph \(C_n\).
Examples
>>> from cfpq_data import * >>> g = labeled_cycle_graph(42) >>> g.number_of_nodes() 42 >>> g.number_of_edges() 42