Welcome to Marks algorithm animation software package
Traversing a graph
Often one needs to visit all nodes in a graph, so we need a systematic way of doing this. One technique is
depth first search.
Depth First Search Algorithm
- Initially mark all nodes as unvisited
- Select a node n as start node and mark it as visited
- Each node adjacent to n is used as start node for a depth first search
- Once all nodes accessible from n have been visited, the search from
n is complete
- If not all nodes have been visited need to pick a new, unvisited start node.
User Manual for Mark's Algorithm Animation System
Before you can run an Algorithm Animation you must first draw the graph
that you would like to be animated.
This is done by either:
- clicking on the Default Graph button
- drawing one manually.
To draw one manually:
- Click anywhere on the canvas to add a node. (not too close to another node/edge, Max 10 nodes)
- Click on a node, drag and release on a different node to create an edge.
(A node will be highlighted to show it has been selected.)
- To move a node, hold shift down and click on desired node and drag to desired position.
Once you are happy with your graph click Play to play the animation,
or Step to step through the animation.
To pause the animation whilst it is running click on the Pause button.
Click on Resume to resume the animation.
To stop the animation at any time it is running click on the Stop button.
To clear the current graph click on the Clear button.
By default the animation will start at node 0. This can be changed by holding down the Alt
key, and clicking a the node you want the animation to start from. This node will be highlighted blue.
Colour code
Cyan nodes represent nodes not yet visited, magenta edges represent edges that have not been traversed.
Yellow nodes represent visited nodes, red edges represent traversed edges.