import conedy as co n = co.network() n.addNode(co.node()) n.addEdge(0, 0, co.weightedEdge(1.0)) n.removeEdges(co.weightedEdge()) print "Should be 0:" print n.meanDegree() n.clear() n.cycle(10000, 2, co.node(), co.staticWeightedEdge(1.0)) n.replaceEdges(0.5, co.weightedEdge()) print "Should be 4:" print n.meanDegree() n.removeEdges(co.weightedEdge()) print "Should be close to 2:" print n.meanDegree()
co.set("nodeVerbosity", 1) co.set("edgeVerbosity", 0) print "nodeVerbosity = 1, edgeVerbosity = 0\n" print "------------------------------------\n" N.printNodeStatistics() print "\n\n" co.set("nodeVerbosity", 2) co.set("edgeVerbosity", 0) print "nodeVerbosity = 2, edgeVerbosity = 0\n" print "------------------------------------\n" N.printNodeStatistics() print "\n\n" j = N.addNode(co.roessler()) N.addEdge(i, j, co.weightedEdge(1.0)) co.set("nodeVerbosity", 2) co.set("edgeVerbosity", 1) print "nodeVerbosity = 2, edgeVerbosity = 1\n" print "------------------------------------\n" N.printNodeStatistics() print "\n\n" co.set("nodeVerbosity", 2) co.set("edgeVerbosity", 2) print "nodeVerbosity = 2, edgeVerbosity = 2\n" print "------------------------------------\n" N.printNodeStatistics() print "\n\n"
import conedy as co n = co.network() n.addNode (co.node()) n.addEdge (0,0,co.weightedEdge(1.0)) n.removeEdges(co.weightedEdge()) print "Should be 0:" print n.meanDegree() n.clear() n.cycle( 10000, 2, co.node(), co.staticWeightedEdge(1.0)) n.replaceEdges (0.5, co.weightedEdge()) print "Should be 4:" print n.meanDegree() n.removeEdges (co.weightedEdge()) print "Should be close to 2:" print n.meanDegree()
co.set("pcoIntegrateFire_noiseFrequency", 0.0) co.set("pcoIntegrateFire_timeDelay", 0.01) co.set("pcoIntegrateFire_t_ref", 0.05) co.set("pcoIntegrateFire_alpha", 0.9) N = co.network() rewiring = 0.5 coupling = 0.012 #n.useLatticePositioning(100,100); N.torusNearestNeighbors(40,40,36.0, co.pcoIntegrateFire(), co.weightedEdge()) N.rewire(rewiring) N.randomizeStates(co.pcoIntegrateFire(), co.uniform(0.0,1.0)); N.randomizeWeights(co.uniform(coupling,coupling)); N.saveAdjacencyList("output/nonconverging.py.graph"); N.observeTime("output/nonconverging.py.phaseCoherence"); N.observePhaseCoherence("output/nonconverging.py.phaseCoherence"); N.evolve(0.0,100.0);
import conedy as co N = co.network(); N.cycle (100,10, co.node(), co.weightedEdge()); print "should be 20:"+ str(N.meanDegree()) N.saveAdjacencyList("output/rewireWeights.co.before"); N.rewireWeights(0.5, co.uniform (2.0,2.0)); N.saveAdjacencyList("output/rewireWeights.co.after"); print "should be close to 1.5:"+ str(N.meanWeight())
import conedy as co N = co.network() source = N.addNode(co.node()) target = N.addNode(co.node()) N.addEdge(source, target, co.weightedEdge(1.0)) print "Should be True: " + str(N.isLinked(source, target)) print "Should be Talse: " + str(N.isLinked(target, source))
import conedy as co co.setRandomSeed(0) N = co.network() N.cycle( 1000, 50, co.node(), co.weightedEdge() ) # Creates a closed chain of 1000 nodes where each is connected to its 50 nearest neighbors to each side. print "should be close to 0.75:" + str(N.meanClustering()) print "should be close to " + str(1000.0 / 2 / 100) + ":" + str( N.meanPathLength()) print "should be 100:" + str(N.meanDegree())
import conedy as co N = co.undirectedNetwork() for i in range (0,100): N.addNode(co.node()) N.addRandomEdges (10.0, co.weightedEdge(0.5)) print "should be 10:" + str(N.meanDegree()) print "should be false:" + str(N.isDirected()) N.setDirected(); N.addRandomEdges (20.0, co.weightedEdge (0.5)) print "should be 20:" + str(N.meanDegree()) print "should be true:" + str(N.isDirected())
import conedy as co N = co.network() co.set ("roessler_a", 0.22) co.set ("roessler_b", 0.1) co.set ("roessler_c", 8.5) r1 = N.addNode(co.roessler()) r2 = N.addNode(co.roessler()) r3 = N.addNode(co.roessler()) N.setParam(r1, "roessler_omega", 1.02) N.setParam(r2, "roessler_omega", 1.0) N.setParam(r3, "roessler_omega", 0.98) N.randomizeStates (co.roessler(), co.uniform (-10.0, 10.0),co.uniform (-5.0, 5.0), co.uniform (-0.5, 1.5)) N.addEdge(r1, r2, co.weightedEdge(0.075)) N.addEdge(r2, r1, co.weightedEdge(0.075)) N.addEdge(r1, r3, co.weightedEdge(0.075)) N.addEdge(r3, r1, co.weightedEdge(0.075)) N.evolve(0.0, 100.0) N.observeTime("roessler.dat") N.observe(r1, "roessler.dat", co.component(1)) N.observe(r2, "roessler.dat", co.component(1)) N.observe(r3, "roessler.dat", co.component(1)) co.set("samplingTime", 0.01) N.evolve(100.0, 200.0)
import conedy as co N = co.network() N.completeNetwork( 10 ) # creates a network of 10 nodes, where every pair is connected by an unweighted edge print "Should be 9: " + str(N.meanDegree()) N.clear() N.cycle(50, 3, co.node(), co.weightedEdge()) N.rewire(0.9) print "Should be 6: " + str(N.meanDegree())
import conedy as co N = co.network() N.randomNetwork(10, 0.1, co.kuramoto(), co.weightedEdge()) N.observeAll("output/observeAll.allStates") for i in range(0, 10): N.observe(i, "output/observeAll.allStates2") N.evolve(0.0, 10.0)
co.set("roessler_b", 0.2) co.set("roessler_c", 10.0) co.set("samplingTime", 0.01) N.addNode(co.roessler()) #co.set("roessler_omega", 1.0) N.setParam(0, "roessler_omega", 1.0) N.addNode(co.roessler()) #N.addWeightedEdge(0,1,0.5) #N.addWeightedEdge(1,0,0.5) N.addEdge(0, 1, co.weightedEdge(0.5)) N.addEdge(1, 0, co.weightedEdge(0.5)) N.setState(0, 0.0, 0.0, 0.0) N.setState(1, 1.0, 1.0, 0.0) N.printNodeStatistics() N.observeTime("output/roesslerRoesslerCoupled.py.series") N.observe(0, "output/roesslerRoesslerCoupled.py.series", co.component(0)) N.observe(0, "output/roesslerRoesslerCoupled.py.series", co.component(1)) N.observe(0, "output/roesslerRoesslerCoupled.py.series", co.component(2)) N.observe(1, "output/roesslerRoesslerCoupled.py.series", co.component(0)) N.observe(1, "output/roesslerRoesslerCoupled.py.series", co.component(1))
import conedy as co N = co.network() N.cycle(100, 4) print "Should be close to %f: %f" % (9. / 14, N.meanClustering()) N.clear() N.torus(40, 40, 1.5, co.node(), co.weightedEdge(1.0)) print "Should be close to %f: %f" % (6. / 14, N.meanClustering())
import conedy as co N = co.network() N.torusNearestNeighbors( 40, 40, 36.0, co.node(), co.weightedEdge() ) #creates a torus of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors and to 2 neighbors with distance 2 randomly chosen print "should be 36.0:" + str(N.meanDegree())
import conedy as co N = co.network() N.line( 1000, 1, co.node(), co.weightedEdge(1.0) ) # Creates a closed chain of 100 nodes where each is connected to its 10 nearest neighbors to each side. print "should be 1000:" + str(N.numberVertices()) print "should be 1.0:" + str(N.meanWeight()) print "should be 0.0:" + str(N.meanClustering()) print "should be 333:" + str(N.meanPathLength()) print "should be close to 2:" + str(N.meanDegree())
import conedy as co N = co.network() N.completeNetwork(10) # creates a network of 10 nodes, where every pair is connected by an unweighted edge print "Should be 9: " + str (N.meanDegree()) N.clear() N.cycle(50, 3, co.node(), co.weightedEdge()) N.rewire(0.9) print "Should be 6: " + str (N.meanDegree())
import conedy as co N = co.undirectedNetwork() N.addNode(co.node()) N.addNode(co.node()) N.addEdge(0, 1, co.weightedEdge(1)) print "Should be false:" + str(N.isDirected()) N.removeEdges(co.weightedEdge(1)) N.setDirected() N.addEdge(0, 1, co.weightedEdge(1)) print "Should be true:" + str(N.isDirected())
import conedy as co N = co.network() N.randomNetwork (10, 0.2, co.node(), co.weightedEdge()); N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat") N.clear() N.createFromAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat") N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat2")
import conedy as co N = co.network() N.lattice (40,40,1.5, co.node(), co.weightedEdge()) #creates a lattice of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors print "should be slightly smaller than 8:" + str(N.meanDegree()) print "should be close to "+ str(12.0/28) +":" + str(N.meanClustering())
import conedy as co N = co.network() firstNode = N.addNode(co.roessler()) secondNode = N.addNode(co.roessler()) N.addEdge (firstNode,secondNode,co.weightedEdge (0.1) ) N.printNodeStatistics()
import conedy as co N= co.network() co.setRandomSeed(0); node = co.roessler() edge = co.weightedEdge(1.0) N.cycle( 1000, 10, node,edge) print "mean degree before rewiring:" + str( N.meanDegree()) print "should be close to 0.75:" + str( N.meanClustering()) N.rewire(1.0) print "mean degree after rewiring:" + str( N.meanDegree()) print "should be close to 0.0:" + str( N.meanClustering()) #print n.meanDegree()
import conedy as co N = co.network() N.line(1000,1, co.node(), co.weightedEdge(1.0)) # Creates a closed chain of 100 nodes where each is connected to its 10 nearest neighbors to each side. print "should be 1000:" + str ( N.size() ) print "should be 1.0:" + str ( N.meanWeight() ) print "should be 0.0:" + str ( N.meanClustering() ) print "should be 333:" + str ( N.meanPathLength() ) print "should be close to 2:" + str ( N.meanDegree() )
import conedy as co N = co.network() N.torus (40,40,1.5, co.node(), co.weightedEdge(1.0)) #creates a torus of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors print "should be 8:" + str(N.meanDegree()) print "should be "+ str(12.0/28) +":" + str(N.meanClustering())
import conedy as co N = co.network() N.completeNetwork(10, co.node(), co.weightedEdge()) N.saveAdjacencyList("output/saveAdjacencyList.py.mat") N.clear() N.createFromAdjacencyList("output/saveAdjacencyList.py.mat") N.saveAdjacencyList("output/saveAdjacencyList.py.mat2")
import conedy as co net = co.network() net.addNode(co.node()) net.addEdge(0, 0, co.weightedEdge(1.0)) net.removeEdges(co.weightedEdge()) print "Should be 0:" + str(net.meanDegree()) net.clear() net.cycle(10000, 2, co.node(), co.staticWeightedEdge()) net.rewire(0.5, co.weightedEdge(1.0)) print "Should be 4:" + str(net.meanDegree()) net.removeEdges(co.weightedEdge(1.0)) print "Should be close to 2:" + str(net.meanDegree())
import conedy as co N = co.network() N.torusNearestNeighbors (40,40,36.0, co.node(), co.weightedEdge()) #creates a torus of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors and to 2 neighbors with distance 2 randomly chosen print "should be 36.0:" + str(N.meanDegree())
import conedy as co N = co.network() firstNode = N.addNode(co.roessler()) secondNode = N.addNode(co.roessler()) N.addEdge(firstNode, secondNode, co.weightedEdge(0.1)) N.printNodeStatistics()
import conedy as co N = co.network() N.addNode(co.kuramoto()) N.addNode(co.kuramoto()) N.addEdge (0,1, co.weightedEdge(2.0)) print "Should be true: " + str (N.isDirected()) N.addEdge (1,0, co.weightedEdge(0.1)) print "Should be true: " + str (N.isDirected()) N.randomizeWeights(co.uniform (3.0, 3.0)) print "Should be false: " + str (N.isDirected())
N = co.network() co.set("roessler_omega", 20.0) co.set("roessler_a", 0.165) co.set("roessler_b", 0.2) co.set("roessler_c", 10.0) co.set("lorenz_S", 10.0) co.set("lorenz_r", 28.0) co.set("lorenz_b", 8.0 / 3.0) co.set("samplingTime", 0.01) i = N.addNode(co.roessler()) j = N.addNode(co.lorenz()) N.addEdge(i, j, co.weightedEdge(2.5)) N.setState(i, 0.0, 0.0, 0.0) N.setState(j, 1.0, 1.0, 1.0) N.observeTime("output/roesslerLorenzCoupled.py.series") N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(0)) N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(1)) N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(2)) N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(0)) N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(1)) N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(2)) N.evolve(0.0, 1500.0)
import conedy as co N = co.undirectedNetwork() N.addNode(co.node()) N.addNode(co.node()) N.addEdge(0,1,co.weightedEdge(1)) print "Should be false:" + str(N.isDirected()) N.removeEdges(co.weightedEdge(1)) N.setDirected() N.addEdge(0,1,co.weightedEdge(1)) print "Should be true:" + str(N.isDirected())
import conedy as co N=co.network() N.addNode(co.node()) N.addNode(co.node()) N.addEdge(0, 1, co.weightedEdge(0.1)) N.isLinked(0, 1) N.removeEdge(0, 1, co.weightedEdge(0.1)) N.isLinked(0, 1)
import conedy as co N = co.network() N.addNode(co.node()) N.addNode() N.addEdge(0, 1, co.weightedEdge(0.3)) N.addEdge(1, 0, co.staticWeightedEdge(0.2)) N.printNodeStatistics() uN = co.undirectedNetwork() sourceNode = uN.addNode(co.node()) targetNode = uN.addNode() #addEdge connects nodes in undirected networks also in the opposite direction. uN.addEdge(sourceNode, targetNode, co.weightedEdge(1.0)) print "linkStrength (should be 1.0):" + str( uN.linkStrength(targetNode, sourceNode))
import conedy as co N = co.directedNetwork() N.randomNetwork(100, 0.2, co.node(), co.weightedEdge(1.0)) print "should be close to 20:" + str( N.meanDegree() ) print "should be close to 0.2:" + str( N.meanClustering() ) print "should be directed:" + str (N.isDirected()) UN = co.undirectedNetwork() UN.randomNetwork(100, 0.2, co.node(), co.weightedEdge(1.0)) print "should be close to 20:" + str( UN.meanDegree() ) print "should be close to 0.2:" + str( UN.meanClustering() ) print "should be undirected:" + str (UN.isDirected())
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 "
import conedy as co net = co.network() net.addNode (co.node()) net.addEdge (0,0,co.weightedEdge(1.0)) net.removeEdges(co.weightedEdge()) print "Should be 0:" + str(net.meanDegree()) net.clear() net.cycle (10000, 2, co.node(), co.staticWeightedEdge()) net.rewire (0.5, co.weightedEdge(1.0)) print "Should be 4:" + str(net.meanDegree()) net.removeEdges (co.weightedEdge(1.0)) print "Should be close to 2:" + str(net.meanDegree())
import conedy as co N = co.network() N.addNode(co.node()) N.addNode(co.node()) #N.addEdge(0,1,co.weightedEdge(0.3)) N.addEdge(0,1,co.weightedEdge(0.3)) N.saveAdjacencyList("output/addEdge.py.adjList")
import conedy as co N = co.network() N.randomNetwork (10,0.1,co.kuramoto(), co.weightedEdge()) N.observeAll ("output/observeAll.allStates") for i in range (0,10): N.observe (i, "output/observeAll.allStates2") N.evolve(0.0,10.0)
""" DOCSTRING: """ self.defaultDict_NetworkType.update(self.__networkParams) self.cycle(self.defaultDict_NetworkType['nodeCount'], self.defaultDict_NetworkType['nearestNeighbours'], self.defaultDict_NetworkType['nodeType'], self.defaultDict_NetworkType['edgeType'] ) self.rewire(self.defaultDict_NetworkType['rewiringProbability'], self.defaultDict_NetworkType['nodeType'] ) self.randomizeStates(self.defaultDict_NetworkType['nodeType'], self.defaultDict_NetworkType['distributionType'] ) self.__networkInitialized = True def __initScaleFree(self): raise IOError ('scaleFree creation not yet defined') def __initRandomGraph(self): raise IOError ('randomGraph creation not yet defined') newNet = Network() newNet.updateNetworkParams({'networkType': 'smallWorld', 'edgeType': co.weightedEdge(0.01), 'nodeType': co.pcoIntegrateFire()}) newNet.initNetwork() #newNet.initNodes() #for i in range(0,10000): # print newNet.getParam(i,'pcoIntegrateFire_t_ref')
import conedy as co N = co.network() N.cycle(99, 1, co.node(), co.weightedEdge(0.25)) print "Should be 100: %f" % N.meanPathLength()
print "nodeVerbosity = 1, edgeVerbosity = 0\n" print "------------------------------------\n" N.printNodeStatistics() print"\n\n" co.set("nodeVerbosity", 2) co.set("edgeVerbosity", 0) print "nodeVerbosity = 2, edgeVerbosity = 0\n" print "------------------------------------\n" N.printNodeStatistics() print"\n\n" j = N.addNode(co.roessler()) N.addEdge(i, j, co.weightedEdge(1.0)) co.set("nodeVerbosity", 2) co.set("edgeVerbosity", 1) print "nodeVerbosity = 2, edgeVerbosity = 1\n" print "------------------------------------\n" N.printNodeStatistics() print"\n\n" co.set("nodeVerbosity", 2) co.set("edgeVerbosity", 2) print "nodeVerbosity = 2, edgeVerbosity = 2\n" print "------------------------------------\n" N.printNodeStatistics() print"\n\n"
import conedy as co N = co.undirectedNetwork() N.cycle(100, 4, co.node(), co.weightedEdge(0.1)) N.rewire(0.3) print "Initial mean degree:" + str(N.meanDegree()) N.removeRandomEdges(0.5, co.weightedEdge(0.1)) print "Should have changed:" + str(N.meanDegree())
import conedy as co N=co.undirectedNetwork() N.cycle(100, 4, co.node(), co.weightedEdge(0.1)) N.rewire(0.3) print "Initial mean degree:" + str(N.meanDegree()) N.removeRandomEdges(0.5, co.weightedEdge(0.1)) print "Should have changed:" + str(N.meanDegree())
import conedy as co N = co.network() i = N.cycle(20, 1, co.node(), co.weightedEdge()) N.addEdge(i + 1, i + 7, co.weightedEdge(1.0)) N.addEdge(i + 7, i + 1, co.weightedEdge(2.0)) N.addEdge(i + 1, i +11, co.weightedEdge(3.0)) N.addEdge(i +11, i + 1, co.weightedEdge(4.0)) N.betweennessCentrality("output/betweennessCentrality.py.out")
co.set("samplingTime", 0.01) N.addNode(co.roessler()) #co.set("roessler_omega", 1.0) N.setParam (0, "roessler_omega", 1.0); N.addNode(co.roessler()) #N.addWeightedEdge(0,1,0.5) #N.addWeightedEdge(1,0,0.5) N.addEdge(0,1,co.weightedEdge(0.5)) N.addEdge(1,0,co.weightedEdge(0.5)) N.setState(0, 0.0,0.0,0.0) N.setState(1, 1.0,1.0,0.0) N.printNodeStatistics(); N.observeTime("output/roesslerRoesslerCoupled.py.series") N.observe(0,"output/roesslerRoesslerCoupled.py.series", co.component(0)) N.observe(0,"output/roesslerRoesslerCoupled.py.series", co.component(1)) N.observe(0,"output/roesslerRoesslerCoupled.py.series", co.component(2))
import conedy as co N = co.network() N.cycle(100, 1, co.node(), co.weightedEdge()) N.randomizeWeights(co.uniform(0.0, 1.50)) print "should be close to 0.75:" + str(N.meanWeight())
import conedy as co from os import system n = co.network() networkSize = 10 n.randomNetwork(networkSize, 0.4, co.node(), co.weightedEdge()) n.randomizeWeights(co.uniform(1.1, 1.1)) n.saveAdjacencyList("output/normalizeInputs.co.before") n.normalizeInWeightSum(3.0) print "Should be " + 3.0 / n.meanDegree() + " :" + n.meanWeight() n.saveAdjacencyList("output/normalizeInputs.co.after") system( "sort -n output/normalizeInputs.co.after -k2 > output/normalizeInputs.co.after.sort" )
#! /usr/bin/env python # -*- coding: utf-8 -*- import conedy as co N = co.network() nodeblueprint = co.gaussianRoessler() co.set("gaussianRoessler_a", 0.165) co.set("gaussianRoessler_b", 0.2) co.set("gaussianRoessler_c", 10.0) co.set("gaussianRoessler_sigmaNoise", 0.1) N.cycle(100, 4, nodeblueprint, co.weightedEdge(0.1)) N.rewire(0.1) print "clustering coefficient:" + str(N.meanClustering()) print "mean path length:" + str(N.meanPathLength()) if N.isConnected(): N.betweennessCentrality("N.betweenness") N.closenessCentrality("N.closeness") N.randomizeParameter("gaussianRoessler_omega", co.uniform(0.8, 1.2)) N.randomizeStates(nodeblueprint, co.uniform(-0.1, 0.1), co.uniform(-0.1, 0.1), co.uniform(-0.1, 0.1)) N.evolve(0.0, 100.0) N.observeTime("output_Roessler")
import conedy as co N = co.network() N.addNode(co.node()) N.addNode() N.addEdge(0, 1, co.weightedEdge(0.3)) N.addEdge(1, 0, co.staticWeightedEdge(0.2)) N.printNodeStatistics() uN = co.undirectedNetwork() sourceNode = uN.addNode(co.node()) targetNode = uN.addNode() # addEdge connects nodes in undirected networks also in the opposite direction. uN.addEdge(sourceNode, targetNode, co.weightedEdge(1.0)) print "linkStrength (should be 1.0):" + str(uN.linkStrength(targetNode, sourceNode))
import conedy as co N = co.network() N.lattice(40, 40, 1.5, co.node(), co.weightedEdge()) print "should be 1600: " + str(N.numberVertices()) N.clear() N.cycle(50, 3, co.node(), co.weightedEdge()) print "should be 50: " + str(N.numberVertices())
import conedy as co N = co.network() N.lattice(40, 40, 1.5, co.node(),co.weightedEdge()) print "should be 1600: " + str(N.size()) N.clear() N.cycle(50, 3, co.node(), co.weightedEdge() ) print "should be 50: " + str(N.size())
import conedy as co N = co.network() N.completeNetwork (10, co.node(), co.weightedEdge()); N.saveAdjacencyMatrix("output/createFromAdjacencyMatrix.py.mat") N.clear() N.createFromAdjacencyMatrix("output/createFromAdjacencyMatrix.py.mat") N.saveAdjacencyMatrix("output/createFromAdjacencyMatrix.py.mat2")
import conedy as co N = co.network() N.randomNetwork(10, 0.2, co.node(), co.weightedEdge()) N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat") N.clear() N.createFromAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat") N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat2")
import conedy as co N = co.network() i = N.cycle(20, 1, co.node(), co.weightedEdge()) N.addEdge(i + 1, i + 7, co.weightedEdge(1.0)) N.addEdge(i + 7, i + 1, co.weightedEdge(2.0)) N.addEdge(i + 1, i + 11, co.weightedEdge(3.0)) N.addEdge(i + 11, i + 1, co.weightedEdge(4.0)) N.closenessCentrality("output/closenessCentrality.py.out")
import conedy as co N = co.network() #N.completeNetwork (10, co.node(), co.weightedEdge()); N.completeNetwork(10) N.saveAdjacencyList("output/createFromAdjacencyList.py.mat") N.clear() N.createFromAdjacencyList("output/createFromAdjacencyList.py.mat", co.node(), co.weightedEdge()) N.saveAdjacencyList("output/createFromAdjacencyList.py.mat2")