@derekjwilliams/depth_first_functional

1.0.2 • Public • Published

DepthFirstFunctional

Simple depth first graph algorithm

Tests

Simple graph

Graph for Depth First Simple tests

  graph TD;
      v0--cost:4-->v1;
      v1--cost:-2-->v2;
      v1--cost:6-->v3;
      v0--cost:5-->v2;
      v2--cost:1-->v3;
      v2--cost:10-->v2;
      v4;

ASCII Art (sucks)

    (v0)
    /  \
  4/    \5
  /      \
*        *
(v1)----*(v2)----|(v4)
  \  -2  / *_____|
  6\    /1    10
    \  /
     **
    (v3)

20 Vertex Graph

Graph for Depth First Moderate tests

  graph TD;
v0--cost:4-->v1;
v1--cost:-2-->v2;
v1--cost:6-->v3;
v0--cost:5-->v2;
v2--cost:1-->v3;
v2--cost:10-->v2;
v3--cost:10-->v4;
v4--cost:10-->v5;
v5--cost:10-->v6;
v3--cost:10-->v6;
v6--cost:10-->v1;
v6--cost:10-->v3;

Future Work

Support loading a graph from a JSON representation, for example GraphSON. GraphML is another option.

Support loading a graph from a (relay based) GraphQL response.

Support loading a graph from a Mermaid specfication

Package Sidebar

Install

npm i @derekjwilliams/depth_first_functional

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

6.87 kB

Total Files

5

Last publish

Collaborators

  • derekjwilliams