Update checked-in dependencies
This commit is contained in:
parent
3e913ef09d
commit
9660df3fcc
990 changed files with 74805 additions and 60149 deletions
49
node_modules/@rtsao/scc/README.md
generated
vendored
Normal file
49
node_modules/@rtsao/scc/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# `@rtsao/scc`
|
||||
|
||||
Find strongly connected components of a directed graph using [Tarjan's algorithm](https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm).
|
||||
|
||||
This algorithm efficiently yields both a topological order and list of any cycles.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
yarn add @rtsao/scc
|
||||
```
|
||||
|
||||
```
|
||||
npm install @rtsao/scc
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const scc = require("@rtsao/scc");
|
||||
|
||||
const digraph = new Map([
|
||||
["a", new Set(["c", "d"])],
|
||||
["b", new Set(["a"])],
|
||||
["c", new Set(["b"])],
|
||||
["d", new Set(["e"])],
|
||||
["e", new Set()]
|
||||
]);
|
||||
|
||||
const components = scc(digraph);
|
||||
// [ Set { 'e' }, Set { 'd' }, Set { 'b', 'c', 'a' } ]
|
||||
```
|
||||
|
||||
#### Illustration of example input digraph
|
||||
```
|
||||
┌───┐ ┌───┐
|
||||
│ d │ ◀── │ a │ ◀┐
|
||||
└───┘ └───┘ │
|
||||
│ │ │
|
||||
▼ ▼ │
|
||||
┌───┐ ┌───┐ │
|
||||
│ e │ │ c │ │
|
||||
└───┘ └───┘ │
|
||||
│ │
|
||||
▼ │
|
||||
┌───┐ │
|
||||
│ b │ ─┘
|
||||
└───┘
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue