Skip to content

anvaka/ngraph.subgraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngraph.subgraph

Builds a subgraph of a graph for a set of nodes.

Usage:

// Let's say you have a `srcGraph` with two edges:
// digraph srcGraph {
//   a -> b;
//   b -> c;
// }

var getSubgraph = require('ngraph.subgraph');
var g1 = getSubgraph(new Set(['a', 'b']), srcGraph);

// Now  g1 has both `a` and `b`, and edge between them:
// digraph g1 {
//   a -> b
// }

// If you pass just 'a', and 'c' - no edge will be present in g2:
var g2 = getSubgraph(new Set(['a', 'c'], srcGraph);

// digraph g2 {
//   a;
//   c;
// }

license

MIT

About

Builds a subgraph of a graph for a set of nodes

Resources

License

Stars

Watchers

Forks

Packages