saveAdjacencyMatrix

network.saveAdjacencyMatrix(fileName)
Writes the adjacency matrix of the network to a file.

Parameters

fileName: string
Name of the file to which the adjacency matrix is written

File format

The text file will contain the entries of the adjacency matrix separated by whitespace and newlines:

0     0.1   0    0.1
0.1   0     0.1  0
0     0.1   0    0.1

createFromAdjacencyMatrix reads files in this format.

Example (python-conedy)

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")

Example (conedy)

network N;

N.randomNetwork (10, 0.2, node(), weightedEdge());

N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat");
N.clear();
N.createFromAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat");

N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat2");

Table Of Contents

Previous topic

saveAdjacencyList

Next topic

saveGraphML