Dijkstra's Shortest Path Algorithm Java source code

Use the left mouse button to create the graph nodes within the light area. Click on two existing nodes, first source then destination, to make an edge between them. A marked node will be unmarked by clicking on it again. If one node is marked and a mouse click is done outside any node, a new node at this place will be created along with an edge to it from the marked one.
Any click on a node with the right mouse button starts the algorithm with the root at this node. The shortest paths from the root are shown in red color. Click the Reload button of your browser to start over and let the applet take the whole space after resizing the window.