GetMxOutDegNId ''''''''''' .. function:: GetMxOutDegNId(Graph) Returns a randomly chosen node from all the nodes with the maximum degree. Parameters: - *Graph*: graph (input) A Snap.py graph or a network Return value: - *NId*: int (output) Id of a node with maximum out degree The following example shows how to use GetMxOutDegNId with :class:`PNGraph`, :class:`PUNGraph`, and :class:`PNEANet`:: import snap G1 = snap.PNGraph.New() G1.AddNode(1) G1.AddNode(2) G1.AddNode(3) G1.AddEdge(1,2) G1.AddEdge(2,1) G1.AddEdge(1,3) G1.AddEdge(1,1) G1.AddEdge(2,3) nid = snap.GetMxOutDegNId(G1) # nid == 1 G2 = snap.PUNGraph.New() G2.AddNode(1) G2.AddNode(2) G2.AddNode(3) G2.AddNode(4) G2.AddEdge(1,2) G2.AddEdge(1,3) G2.AddEdge(1,4) G2.AddEdge(2,4) nid = snap.GetMxOutDegNId(G2) # nid == 1 G3 = snap.PNEANet.New() G3.AddNode(1) G3.AddNode(2) G3.AddNode(3) G3.AddEdge(1,2) G3.AddEdge(2,1) G3.AddEdge(1,3) G3.AddEdge(1,1) G3.AddEdge(2,3) nid = snap.GetMxOutDegNId(G3) # nid == 1