0.1.4 • Published 9 years ago

ngraph.toedgelist v0.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

ngraph.toedgelist Build Status

Save ngraph.graph into edge list.

usage

// let's say your graph has three edges:
var graph = require('ngraph.graph')();
graph.addLink(1, 2);
graph.addLink(1, 3);
graph.addLink(2, 4);

var toEdgeList = require('ngraph.toedgelist');
var edgeList = toEdgeList(graph);

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.asString(graph);

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

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago