ngraph.toedgelist

0.1.4 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i ngraph.toedgelist

Weekly Downloads

0

Version

0.1.4

License

MIT

Last publish

Collaborators

  • anvaka