0.10.0 • Published 1 year ago

tinygraphs v0.10.0

Weekly downloads
420
License
mit
Repository
github
Last release
1 year ago

tinygraphs

Small graph library for directed and undirected graphs.

DirectedGraph

Provides very basic functionality for directed graphs, mainly calculating reachable vertices.

const dg = new DirectedGraph();
dg.addEdge( 0, 1 );
dg.addEdge( 1, 2 );
dg.addEdge( 2, 3 );
dg.reachableVertices( 0 ); // [ 0, 1, 2, 3 ]

API:

DirectedGraph
-------------
edgeArray()
hasEdge(from, to)
addEdge(from, to)
reachableVertices(from)
colourise()

UndirectedGraph

This class is almost identical to DirectedGraph except that addEdge adds an edge in both directions.

Changelog

  • v0.10.0 (2023-02-21)
    • Added: DirectedGraph now has source code comments, readme (this file) improved
    • Changed: Update to latest TypeScript version
  • v0.9.0 (2019-04-02)
    • Previous release. Not sure if it worked correctly.