Returns the (approximation of the) Effective Diameter (90-th percentile of the distribution of shortest path lengths) of a graph (by performing BFS from NTestNodes random starting nodes).
Parameters:
A Snap.py graph or a network.
The number of random start nodes to use in the BFS used to calculate the graph diameter and effective diameter.
Indicates whether the edges should be considered directed or undirected.
Return value:
The (approximation of the) Effective Diameter of a graph.
The following example shows how to calculate BfsEffDiam for nodes in TNGraph, TUNGraph, and TNEANet:
import snap
Graph = snap.GenRndGnm(snap.PNGraph, 100, 1000)
NTestNodes = 10
IsDir = False
EffDiam = snap.GetBfsEffDiam(Graph, NTestNodes, IsDir)
print EffDiam
UGraph = snap.GenRndGnm(snap.PUNGraph, 100, 1000)
NTestNodes = 10
IsDir = False
EffDiam = snap.GetBfsEffDiam(UGraph, NTestNodes, IsDir)
print EffDiam
Network = snap.GenRndGnm(snap.PNEANet, 100, 1000)
NTestNodes = 10
IsDir = False
EffDiam = snap.GetBfsEffDiam(Network, NTestNodes, IsDir)
print EffDiam