Strongly Connected Components Calculator

Map cycles, clusters, and mutual reachability in digraphs. Review component sizes, counts, and condensation structure. Visual results help validate inputs and explain graph behavior.

Calculator input

Used when labels are blank. Labels override this count.
Separate labels with commas or line breaks. Keep labels unique.
Accepted edge formats: A,B, A B, or A->B. One edge per line. Duplicate edges are ignored automatically.

Example data table

The sample graph below is the default dataset preloaded into the form.

Source Target Interpretation
ABPart of a three-node mutual cycle
BCContinues the first cycle
CACloses SCC {A, B, C}
CDConnects first SCC to second SCC
DEForms a two-node mutual group
EDCloses SCC {D, E}
EFFeeds into a later SCC
FGBegins a two-node cycle
GFCloses SCC {F, G}
HHCreates a cyclic singleton SCC

Formula used

A strongly connected component is a maximal subset of vertices where every pair of vertices can reach each other through directed paths.

Reachability rule: vertices u and v belong to the same SCC when u ⇢ v and v ⇢ u.

Tarjan low-link method:

  • disc[u] = discovery order assigned during depth-first search.
  • low[u] = smallest discovery value reachable from u through DFS tree edges and stack-preserving back edges.

low[u] = min( disc[u], disc[v] for back edges, low[w] for DFS children w )

When low[u] = disc[u], vertex u is the root of one complete strongly connected component. The calculator also builds a condensation graph, where each SCC becomes one node and edges connect different components.

How to use this calculator

  1. Enter a graph name for your report and export files.
  2. Provide vertex labels, or enter a vertex count and choose 0-based or 1-based indexing.
  3. Paste one directed edge per line using comma, space, or arrow notation.
  4. Choose how you want the returned components ordered.
  5. Press Analyze strongly connected components.
  6. Review the summary metrics, component table, vertex diagnostics, and Plotly visualization.
  7. Use the CSV button for structured tabular output and the PDF button for a printable report.

FAQs

1) What is a strongly connected component?

It is a maximal group of vertices in a directed graph where each vertex can reach every other vertex in that same group through directed paths.

2) Which method does this calculator use?

It uses Tarjan’s algorithm. That method tracks discovery order and low-link values during one depth-first traversal to identify SCC roots efficiently.

3) Why are low-link values important?

Low-link values show the earliest discovery index reachable from a vertex while respecting the active DFS stack. Matching discovery and low-link values mark component roots.

4) Does edge direction matter here?

Yes. SCC analysis is defined for directed graphs. Reversing or removing one directed edge can split a previously connected component into smaller groups.

5) Can an isolated vertex be its own SCC?

Yes. Any single vertex forms an SCC by itself. It becomes a cyclic singleton only when it also has a self-loop.

6) What does the condensation graph mean?

The condensation graph collapses every SCC into one node. The resulting graph is always acyclic, which helps you study high-level dependency flow between components.

7) How are duplicate or invalid edges handled?

Duplicate edges are ignored to avoid double counting. Invalid lines are skipped, and the calculator reports them in the notes section after analysis.

8) When is the whole graph strongly connected?

The whole graph is strongly connected when the algorithm finds exactly one SCC containing all vertices, meaning every vertex can reach every other vertex.

Related Calculators

adjacency matrix generatorpagerank calculatortopological sort calculatorminimum spanning tree calculatorgraph intersection calculatorgraph distance calculatorrandom graph generatorprim algorithm calculatorbreadth first search calculatorgraph compression calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.