Strongly Connected Components

Demo

  • On the experiment panel you will see a graph, a stack and 2 tabs denoting whether the DFS 1 or DFS 2 is running.
  • The graph will a directed graph. The nodes will be numbered from 0 to n-1 where n is the number of nodes in the graph.
  • The stack will be empty initially. It will be used to show the order in which the nodes are visited in the DFS.

    Observation

  • While the DFS 1 is running try to see the order in which the nodes are visited, and how the stack is updated.
  • After DFS 1 is completed, the order of the edges in the graph will be reversed.
  • Now try to see how the components are coloured in DFS 2.

Practice

  • The practice part is quite similar to the demo. As you progress, you will encounter questions that require answers to proceed.

Exercise

  • On the experiment panel you will see only a graph.
  • By clicking on a node, you can change the color.
  • The node can be colored with the following colors green, violet, orange, blue, yellow, brown,black, grey.
  • Clicking on a node once will turn it green; clicking on it again will change its color to violet, and so on. If you click on a node with a grey color, it will turn green.
  • The task is to give each component a unique color.

Observation

  • The observation panel will show if the answer is correct or not.