Description
This is a proof of concept for an interactive tool for visualizing small graphs. This is created entirely without the aid of external libraries as an exercise in Javascript and Graph Theory.
In future revisions, I plan on adding planarity checking, detection of strongly connected components, and Finite Discrete Markov Chain support.
Features:
- Dynamic addition and removal of vertices and edges as well as modification of weights.
- Dynamic tracking of connected components for undirected graphs.
- Shortest path computation.
Instructions
- Left click on one of the above options to use the graph interface.
- Inside the interface, you may left click to add a new vertex.
- Left click on an existing vertex to select it and left click on a selected vertex to deselect it.
- Left click on two vertices to join them by an edge. You may also join a selected vertex to a new vertex by left clicking on an empty space.
- Right click on an existing vertex to delete it.
- Left click on an edge weight to change its value. If the new edge weight is 0, then the edge will be deleted. Negative edge weights for undirected graphs are not permitted as this would create a negative cycle.
- As vertices and edges are added, removed, or modified, you can track and change information about the graph in the space below the canvas.
- Hit the "Reset Graph" button to delete all vertices and edges from the graph.