An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# konigsberg

[![Build Status](https://github.com/jledentu/konigsberg/actions/workflows/ci.yml/badge.svg?branch=master)](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

```