Spanning Tree Construction

Objective

Given a connected graph, the objective of this system is to build a spanning tree of the graph by selecting a subset of its edges.

Graph Color Codes

The table below, lists all the colors used in the graph, along with their interpretations.

Node/Edge Color Type
Unselected Node
Selected Node
Unselected Edge
Selected Edge
Cycle Forming Edge

Experiment Setup

In this system, you are provided with a connected graph. You can click on any edge to add the edge (and connecting nodes) to the sub-graph.

At any point while building the sub-graph, you can click on any edge to remove it from the tree.

Procedure

  1. Pick a non-cycleforming edge, to add it to the sub-graph.
  2. Check if all nodes have been added to the sub-graph. If not, then observe that the intermediate sub-graphs can be forests and repeat step 1. Otherwise Spanning Tree is completed.

Graph
Spanning Tree