Utilities for directed and undirected graphs
npm install dangraph_DanGraph_ is a library written in typescript to manipulate directed and undirected graphs
Building a graph is as simple as invoking a class constructor and a couple of very simple methods.
Es:
``ts`
import { DirectedGraph, CDanNode, CDanArc } from 'dangraph';
const myGraph = new DirectedGraph.DanDirectedGraph
myGraph.addArcToNode(
new CDanNode({ id: 1 }),
new CDanArc({ weight: 1, node: new CDanNode({ id: 2 }) }),
DirectedGraph.ArcType.outgoing
);
Read more about
- Directed Graphs
- Depth-First Iterator
- Breadth-First Iterator
- Undirected Graphs
npm run build
npm run test
npm run build:doc`