GetMxInDegNId

GetMxInDegNId(Graph)

Returns the node id of a randomly chosen node from all the nodes in Graph with the maximum in-degree.

Parameters:

  • Graph: graph (input)

    A Snap.py graph or a network.

Return value:

  • int

    The node id of a randomly chosen node from all the nodes in Graph with the maximum in-degree.

The following example shows how to use GetMxInDegNId() with TNGraph, TUNGraph, and TNEANet:

import snap

Graph = snap.GenRndGnm(snap.PNGraph, 100, 1000)
NId1 = snap.GetMxInDegNId(Graph)
print NId1

UGraph = snap.GenRndGnm(snap.PUNGraph, 100, 1000)
NId2 = snap.GetMxInDegNId(UGraph)
print NId2

Network = snap.GenRndGnm(snap.PNEANet, 100, 1000)
NId3 = snap.GetMxInDegNId(Network)
print NId3

Previous topic

GetMxDegNId

Next topic

GetMxOutDegNId

This Page