konigsberg
v0.0.1
Published
A browser/Node.js library for manipulating graphs
Downloads
1
Readme
konigsberg
A browser/Node.js library for manipulating graphs and executing graph theory algorithms.
Features
- Directed and undirected graphs
- Customizable data on nodes and edges
- Simple search algorithms (Depth First Search and Breadth First Search at the moment)
- Unit tested
Installation
Install Konigsberg with npm:
npm install konigsberg
Or Bower:
bower install konigsberg
Usage
In Node.js / Webpack / Browserify:
var konigsberg = require('konigsberg');
var g = new konigsberg.DirectedGraph();
In the browser:
<script src="konigsberg.js"></script>
<script>
var g = new konigsberg.DirectedGraph();
g.addNode('A');
g.addNode('B');
g.addEdge('A', 'B');
console.log(g.hasEdge('A', 'B')); // true
</script>