1.2.0 • Published 2 years ago

ngraph.subgraph v1.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
2 years ago

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