isConnected

isConnected()
Returns True, iff every node is reachable from every other node in the network.

Example (python-conedy)

import conedy as co

N = co.network()

i = N.addNode(co.kuramoto())
j = N.addNode(co.kuramoto())

N.addEdge(j, i, co.weightedEdge(1.0))
print "should return an error: "
if( N.isConnected() ):
      print ""
print "\n"

N.clear()
N.cycle(500, 1)
print "should be connected: "
if( N.isConnected() ):
      print "connected "
print "\n"

N.addNode(co.kuramoto())
print "should be disconnected: "
if not( N.isConnected() ):
      print "disconnected "

Example (conedy)

network N;

N.addNode(kuramoto());
N.addNode(kuramoto());

N.addEdge(0,1,weightedEdge (1.0));
print "should give an error: ";
if( N.isConnected() )
{
print "";
};
print newline;

N.clear();
N.cycle(500,1, kuramoto());


print "should be connected: ";
if( N.isConnected() )
{
      print "connected ";
};
print newline;

N.addNode(kuramoto());
print "should be disconnected: ";
if( !N.isConnected() )
{
      print "disconnected ";
};

Table Of Contents

Previous topic

getState

Next topic

meanClustering