Note
This page is a draft and under revision.
Note
This function is not yet supported.
Return the number of length 2 paths between a pair of nodes.
Parameters:
A Snap.py graph or a network
ID of the source node
ID of the destination node
List of nodes on each path between node NId1 and node NId2. The list is filled by the function.
Return value:
The following example shows how to use GetLen2Paths in PUNGraph, PNGraph, and PNEANet (NOTE: at the time this document was written, GetLen2Paths is not implemented yet so the author could not verify the code):
import snap
g = snap.GenRndGnm(snap.PUNGraph, 100, 1000)
middle_nodes = snap.TIntV()
print snap.GetLen2Paths(g, 0, 1, middle_nodes)
g = snap.GenRndGnm(snap.PNGraph, 100, 1000)
middle_nodes = snap.TIntV()
print snap.GetLen2Paths(g, 0, 1, middle_nodes)
g = snap.GenRndGnm(snap.PNEANet, 100, 1000)
middle_nodes = snap.TIntV()
print snap.GetLen2Paths(g, 0, 1, middle_nodes)