# strongly-connected-components

> Computes strongly connected components of a directed graph

Latest version **1.0.1** (published 2014-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install strongly-connected-components
pnpm add strongly-connected-components
yarn add strongly-connected-components
bun add strongly-connected-components
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2014-03-31 |
| First published | 2013-10-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | strongly, connected, component, directed, graph, tarjan |

## Links

- npm: https://www.npmjs.com/package/strongly-connected-components
- Repository: https://github.com/mikolalysenko/strongly-connected-components
- Issues: https://github.com/mikolalysenko/strongly-connected-components/issues
- npm.io page: https://npm.io/package/strongly-connected-components

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2014-03-31
- 1.0.0 — 2014-01-16
- 0.0.0 — 2013-10-31

## README

strongly-connected-components
=============================
Given a directed graph, splits it into [strongly connected components](http://en.wikipedia.org/wiki/Strongly_connected_component).

## Example

```javascript
var scc = require("strongly-connected-components")

var adjacencyList = [
  [4], // 0
  [0,2], // 1
  [1,3], // 2
  [2], // 3
  [1], // 4
  [4,6], // 5
  [5,2], // 6
  [7,6,3], // 7
]

console.log(scc(adjacencyList))
```

## Install

    npm install strongly-connected-components

## API

### `require("strongly-connected-components")(adjacencyList)`
Computes the strongly connected components of a graph using Tarjan's algorithm.

* `adjacencyList` is an array of lists representing the directed edges of the graph

**Returns** An object containing:

* `components`: an array of arrays representing the partitioning of the vertices in the graph into connected components.
* `adjacencyList`: an array lists representing the directed edges of the directed acyclic graph between the strongly connected components

## Credits
(c) 2013 Mikola Lysenko. MIT License.  Based on the [implementation of Tarjan's algorithm on Wikipedia.](http://en.wikipedia.org/wiki/Tarjan's_strongly_connected_components_algorithm)

---
_Source: https://npm.io/package/strongly-connected-components · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
