Given a connected graph, the objective of this system is to build a spanning tree of the graph via DFS traversal of the graph.
The table below, lists all the colors used in the graph, along with their interpretations.
Node/Edge Color | Type |
Unselected Node | |
Selected Node | |
Active Node | |
Unselected Edge | |
Candidate Edge | |
Selected Edge |
In this system, you are provided with a connected graph. Stack is used as an auxillary data structure. You can click on any node to select it. Candidate Edges can be clicked, to add those edge to the sub-graph. Clicking other nodes is not permitted after selecting a node. A button called "Backtrack" can be clicked to perform a backtrack operation.
This traversal process traverses deeper into the graph, by exploring unvisited edges leaving out from the most recently visited vertex. When there is no deeper level to go in the graph, the algorithm moves back (backtrack) to the vertex from which current vertex was discovered,.
After selecting the first node, you will see spanning tree beside the graph. At this point the tree has just the one selected node, which is also the active node. Now, you will observe that the edges connected to the active node are marked as "candidates" (See the color codes table).
Select any node to add it to the tree.