Decides whether the given tournament is strongly connected.
This function is more theoretically efficient than the
The given graph must be a tournament, otherwise this function’s behavior is undefined.
- GNetworkX graph
A directed graph representing a tournament.
Whether the tournament is strongly connected.
Although this function is more theoretically efficient than the generic strong connectivity function, a speedup requires the use of parallelism. Though it may in the future, the current implementation does not use parallelism, thus you may not see much of a speedup.
This algorithm comes from .
Tantau, Till. “A note on the complexity of the reachability problem for tournaments.” Electronic Colloquium on Computational Complexity. 2001. <http://eccc.hpi-web.de/report/2001/092/>
>>> from networkx.algorithms import tournament >>> G = nx.DiGraph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3), (3, 0)]) >>> tournament.is_strongly_connected(G) True >>> G.remove_edge(1, 3) >>> tournament.is_strongly_connected(G) False