is_branching#
- is_branching(G)[source]#
Returns True if
G
is a branching.A branching is a directed forest with maximum in-degree equal to 1.
- Parameters:
- Gdirected graph
The directed graph to test.
- Returns:
- bbool
A boolean that is True if
G
is a branching.
See also
Notes
In another convention, a branching is also known as a forest.
Examples
>>> G = nx.DiGraph([(0, 1), (1, 2), (2, 3), (3, 4)]) >>> nx.is_branching(G) True >>> G.remove_edge(2, 3) >>> G.add_edge(3, 1) # maximum in-degree is 2 >>> nx.is_branching(G) False ----
Additional backends implement this function
cugraph : GPU-accelerated backend.