Simple library for work with directed acyclic graphs.
A graph is based on the Adjacency List and provides the features below.
V
- the total number of Vertices.
E
- the total number of Edges in the Graph.
Available features with algorithmic complexity:
- Add Vertex -
O(1)
- Add Edge -
O(1)
- Update Vertex and get adjacent Vertices -
O(1)
- Remove Vertex -
O(V + E)
- Remove Edge -
O(E)
- Breadth First search -
O(V + E)
- Depth First search -
O(V + E)
- Detect cycles in Graph -
O(V + E)
- Find the shortest path between two Vertices -
O(V + E)
- Check if a path exists between two Vertices -
O(V + E)
- Find Mother Vertex -
O(V(V + E))
Prerequisites:
- Node 16+
- npm 5+
- git latest
To set up the app execute the following commands.
git clone https://github.com/rejth/grapherx.git
cd grapherx
npm install
Builds the app for production to the dist
folder.
Run unit tests.
Generate types declarations.