GetNodeOutDegV¶
-
GetNodeOutDegV()¶
A graph method that returns the out-degree for every node.
Parameters:
None
Return value:
- NIdOutDegV:
TIntPrV, a vector of (int, int) pairs A vector of (node id, node out degree) pairs.
- NIdOutDegV:
The following example shows how to use GetNodeOutDegV() with nodes in TNGraph, TUNGraph, and TNEANet:
import snap
Graph = snap.GenRndGnm(snap.TNGraph, 100, 1000)
OutDegV = Graph.GetNodeOutDegV()
for item in OutDegV:
print("node ID %d: out-degree %d" % (item.GetVal1(), item.GetVal2()))
UGraph = snap.GenRndGnm(snap.TUNGraph, 100, 1000)
OutDegV = UGraph.GetNodeOutDegV()
for item in OutDegV:
print("node ID %d: out-degree %d" % (item.GetVal1(), item.GetVal2()))
Network = snap.GenRndGnm(snap.TNEANet, 100, 1000)
OutDegV = Network.GetNodeOutDegV()
for item in OutDegV:
print("node ID %d: out-degree %d" % (item.GetVal1(), item.GetVal2()))