ngraph.toedgelist
Save ngraph.graph into edge list.
usage
// let's say your graph has three edges:var graph = ;graph;graph;graph;var toEdgeList = ;var edgeList = ;
Now edgeList
is equal to [ [ 1, 2 ], [ 1, 3 ], [ 2, 4 ] ]
.
Edge list as a string
You can also save edge list as string:
var str = toEdgeList;
The str
variable is now equal to:
# generated by ngraph.toedgelist
# Nodes: 4
# Edges: 3
# FromId ToId
1 2
1 3
2 4
install
With npm do:
npm install ngraph.toedgelist
license
MIT