# Tarjan

Tarjan's strongly connected components algorithm is an algorithm in graph theory for finding the **strongly connected components (SCCs)** of a directed graph. It runs in linear time, matching the time bound for alternative methods including Kosaraju's algorithm and the path-based strong component algorithm. The algorithm is named for its inventor, Robert Tarjan.

![](/files/-MkkZ27v3MHwp8T0UJuD)

![](/files/-MkkZ27wJAer55nerlCH)

## References

* <https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm>
* \[Tarjans Strongly Connected Components algorithm | Graph Theory

  ]\(<https://youtu.be/TyWtx7q2D7Y>)

## Problems

* [1192. Critical Connections in a Network (Hard)](https://leetcode.com/problems/critical-connections-in-a-network/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://liuzhenglaichn.gitbook.io/algorithm/graph/tarjan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
