IsWeaklyConn (SWIG)ΒΆ

IsWeaklyConn(Graph)

Tests whether Graph is weakly connected.

Parameters:

  • Graph: graph (input)

    A Snap.py graph or a network.

Return value:

  • bool

    Returns True if the Graph is weakly connected, False otherwise.

The following example shows how to use IsWeaklyConn() for nodes in TNGraph, TUNGraph, and TNEANet:

import snap

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

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

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