How to Use the MST Applet
Notations
- Source is in black.
- Intermediate nodes are in gray.
- Initial edges are in gray.
- The number associated with the corresponding edge is edge's
weight
- The edges in shortest path are in red.
- The selected vertices are in black.
- The eligible selected vertices flash in yellow color .
- The graph can not be changed when it is running or in running
status.
How to Run the Applet
The Applet consists of 6 steps , which can be run either in
demo or custom mode. In each mode you can choose to run any of the 3 algorithms: Kruskal, Prim or Cheriton-Tarjan. The applet can be started at step 1 in each
execution, and you can go back and forward between the steps if the step(e.g.
buttons, menues) are activated. Below is a list of functions:
Step1 :
- Demo: choose this in step1 to run from a demo graph.
- Custom: choose this in step1 to build a graph.
Step2:
If custom mode is chosen, construct your own graph using these buttons:
- To create a vertex, press mouse on the desired location.
- To create an edge, click on the two vertices desired to be
connected, enter edge weight in the bottom-left text box and press OK button.
Edge weight can only be
nonnegative integer. Default edge weight is
0.
- To modify a vertex position, drag the vertex with mouse to the
desired position.
- To modify an edge weight, double click on the arrow of the desired
edge, enter edge weight in the bottom-left text box and press OK button.
- To delete a vertex, double click on the desired vertex and click on
the Remove Vertex button. All connected edges to this vertex
will also be deleted.
- To delete an edge, double click on the arrow of the desired edge
and click on the Remove Edge button.
- To cancel an operation of edge deletion or edge weight
modification, click on the Cancel button.
Step3:
choose the minimum spanning tree algorithm to run.
Step4:
Source: If prim is
chosen in custom mode after the graph is constructed choose a source by double
clicking on the desired vertex and click on source button
Step5:
Algorithm can be run using any of these buttons:
click on this button to trace every
step.
Run till Finish: click on this button to run the
algorithm until finish.
Stop:
click on this button whenever you want to stop
the Run till Finish mode.
Step6:
After the execution of algorithm is finished use these:
- Clear: click on this button applet will clear the
graph in Custom
mode for construction of a new graph.
- Reset: click on this button will restore the
graph to the graph before running on Custom mode or Demo mode.