The sandbox is an interactable and customizable tool designed as an educational look for routing algorithms. The two algorithms provide are
To get started, simply click the "Run Dijkstra" button or the "Run Bellman-Ford" button to run each respective algorithm.
After you clicked either button, depending on the algorithm you selected, either one or two pop-up boxes will appear asking for information.
If you chose Djikstra's algorithm, then two pop-ups will appear, asking for the start and end node respectively:
Otherwise if you choose Bellman-Ford's algorithm, then it will only ask for the start node. Please enter an integer corresponding to the node number on the sandbox. You can also type "N5" for example for Node number 5, but just 5 will do. Indexes start at 0.
Once you have entered the input information (correctly I hope), The sandbox will enter animation mode, which will visually display the chosen algorithm step by step. To facilitate this use the animation control buttons that will appear once the sanbox is put in animation mode.
You should now also see a table appear under the "Algorithm Tracker section" which details the current trace of the selected algorithm.
By pressing the "Step" button, it will proceed one step in the chosen algorithm, updating the table and also providing a visual representation in the sandbox.
You can continue to press the "Step" button to go through the chosen algorithm until it finishes. By then, the sandbox will show the result of the algorithm and the table will be completed. You can then press the "Exit Animation" button to leave animation mode and return back to edit mode.
Once animation mode is exited, you can edit the network and run another algorithm. Have fun!
By default, there will be a pre-made network made for you when you load the page, but it's called a "sandbox" for a reason.
Press the "Clear" button to wipe the network
To add a node to the network, simply click any where in the network editor
You can also drag nodes anywhere on the network editor
To create an edge, click the "Add Edge" Button. You will be prompted for the start and end node of the edge. Please enter an integer corresponding to the node number on the sandbox. You can also type "N5" for example for Node number 5, but just 5 will do. Indexes start at 0. A third pop-up will also appear for the edge cost. Please enter an integer. Note that the order of the start and end nodes do not matter since the network is bidirectional.
If you are not feeling creative, you can also press the "Randomize button to generate a network for you. Note you can still edit a generated network however you want.
To undo any action (adding a node, dragging a node, adding an edge, clearing the
network, generating a random network) simply press the "Undo" button
OR
press
Ctrl + Z
on your keyboard
Now that you've learned how to use the tool, go to our Sandbox page to try it out yourself.