_two_sweep_directed(G, seed)
It implements 2-dSweep, the directed version of the 2-sweep algorithm. The algorithm follows the following steps. 1. Select a source node $s$ at random. 2. Perform a forward BFS from $s$ to select a node $a_1$ at the maximum distance from the source, and compute $LB_1$, the backward eccentricity of $a_1$. 3. Perform a backward BFS from $s$ to select a node $a_2$ at the maximum distance from the source, and compute $LB_2$, the forward eccentricity of $a_2$. 4. Return the maximum between $LB_1$ and $LB_2$.
G
is a NetworkX directed graph.
seed
is a random.Random or numpy.random.RandomState instance
Helper function for finding a lower bound on the diameter
for directed Graphs.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them