cfpq_data.graphs.generators.labeled_two_cycles_graph#
- labeled_two_cycles_graph(n: int | Iterable[Any], m: int | Iterable[Any], *, common_node: int | Any = 0, labels: Tuple[str, str] = ('a', 'b')) MultiDiGraph[source]#
Returns a graph with two cycles connected by one node. With labeled edges.
- Parameters:
- nUnion[int, Iterable[Any]]
The number of nodes in the first cycle without a common node. If n is an integer, nodes are from
range(n). If n is a container of nodes, those nodes appear in the graph.- mUnion[int, Iterable[Any]]
The number of nodes in the second cycle without a common node. If m is an integer, nodes are from
range(n). If m is a container of nodes, those nodes appear in the graph.- common_nodeUnion[int, Any]
The node along which two cycles are connected.
- labels: Tuple[str, str]
Labels that will be used to mark the edges of the graph.
- Returns:
- gMultiDiGraph
A graph with two cycles connected by one node.
Examples
>>> from cfpq_data import * >>> g = labeled_two_cycles_graph(42, 29) >>> g.number_of_nodes() 72 >>> g.number_of_edges() 73