https://github.com/jledentu/konigsberg
A browser/Node.js library for manipulating graphs and executing graph theory algorithms
https://github.com/jledentu/konigsberg
edges graphs shortest-paths vertices
Last synced: 8 months ago
JSON representation
A browser/Node.js library for manipulating graphs and executing graph theory algorithms
- Host: GitHub
- URL: https://github.com/jledentu/konigsberg
- Owner: jledentu
- License: mit
- Created: 2017-02-22T17:17:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-19T15:03:31.000Z (about 9 years ago)
- Last Synced: 2025-06-18T06:06:08.562Z (about 1 year ago)
- Topics: edges, graphs, shortest-paths, vertices
- Language: JavaScript
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# konigsberg
[](https://github.com/jledentu/konigsberg/actions)
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
```
## Usage
In Node.js / Webpack / Browserify:
```js
var konigsberg = require('konigsberg');
var g = new konigsberg.DirectedGraph();
```
In the browser:
```html
var g = new konigsberg.DirectedGraph();
g.addNode('A');
g.addNode('B');
g.addEdge('A', 'B');
console.log(g.hasEdge('A', 'B')); // true
```