Note
This page is a draft and under revision.
Note
This function is not yet supported.
Returns the number of length 2 directed paths between a pair of nodes NId1, NId2 (NId1 –> U –> NId2).
Parameters:
A Snap.py graph or a network.
ID of first node.
ID of second node.
Return value:
The following example shows how to calculate the number of length 2 directed paths between nodes within a TNGraph, TUNGraph, and TNEANet:
import snap
Graph = snap.GenRndGnm(snap.PNGraph, 100, 1000)
NumLen2Paths = snap.GetLen2Paths(Graph, 0, 1)
Graph = snap.GenRndGnm(snap.PUNGraph, 100, 1000)
NumLen2Paths = snap.GetLen2Paths(Graph, 0, 1)
Graph = snap.GenRndGnm(snap.PNEANet, 100, 1000)
NumLen2Paths = snap.GetLen2Paths(Graph, 0, 1)