{"_id":"@rtsao/scc","_rev":"3919064","name":"@rtsao/scc","description":"Find strongly connected components of a directed graph using [Tarjan's algorithm](https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm).","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"rtsao","email":""}],"time":{"modified":"2025-09-01T01:21:36.000Z","created":"2019-04-15T16:39:13.021Z","1.1.0":"2022-04-06T17:07:36.584Z","1.0.0":"2019-04-15T16:39:13.021Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/rtsao/scc.git"},"versions":{"1.1.0":{"name":"@rtsao/scc","version":"1.1.0","repository":{"type":"git","url":"git+https://github.com/rtsao/scc.git"},"main":"index.js","license":"MIT","gitHead":"1120edc92040b0ca748ab62a882a98565c85deed","description":"Find strongly connected components of a directed graph using [Tarjan's algorithm](https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm).","bugs":{"url":"https://github.com/rtsao/scc/issues"},"homepage":"https://github.com/rtsao/scc#readme","_id":"@rtsao/scc@1.1.0","_nodeVersion":"14.10.1","_npmVersion":"7.18.1","dist":{"shasum":"927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8","size":1862,"noattachment":false,"key":"/@rtsao/scc/-/@rtsao/scc-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@rtsao/scc/download/@rtsao/scc-1.1.0.tgz"},"_npmUser":{"name":"rtsao","email":"ryan.j.tsao@gmail.com"},"directories":{},"maintainers":[{"name":"rtsao","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scc_1.1.0_1649264856486_0.13558468231049892"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-07T01:10:26.324Z","publish_time":1649264856584,"_cnpm_publish_time":1649264856584},"1.0.0":{"name":"@rtsao/scc","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/rtsao/scc.git"},"main":"index.js","license":"MIT","gitHead":"6f1e9018758bac4ae9c0facd72265e6633c59de1","description":"Find strongly connected components of a directed graph using Tarjan's algorithm.","bugs":{"url":"https://github.com/rtsao/scc/issues"},"homepage":"https://github.com/rtsao/scc#readme","_id":"@rtsao/scc@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"rtsao","email":"ryan.j.tsao@gmail.com"},"dist":{"shasum":"fe33974e74d31ac5bed4f427d843364aebabd5ab","size":1679,"noattachment":false,"key":"/@rtsao/scc/-/@rtsao/scc-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@rtsao/scc/download/@rtsao/scc-1.0.0.tgz"},"maintainers":[{"name":"rtsao","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scc_1.0.0_1555346352921_0.23059262953909054"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T00:32:01.444Z","publish_time":1555346353021,"_cnpm_publish_time":1555346353021}},"readme":"# `@rtsao/scc`\n\nFind strongly connected components of a directed graph using [Tarjan's algorithm](https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm).\n\nThis algorithm efficiently yields both a topological order and list of any cycles.\n\n## Installation\n\n```\nyarn add @rtsao/scc\n```\n\n```\nnpm install @rtsao/scc\n```\n\n## Usage\n\n```js\nconst scc = require(\"@rtsao/scc\");\n\nconst digraph = new Map([\n  [\"a\", new Set([\"c\", \"d\"])],\n  [\"b\", new Set([\"a\"])],\n  [\"c\", new Set([\"b\"])],\n  [\"d\", new Set([\"e\"])],\n  [\"e\", new Set()]\n]);\n\nconst components = scc(digraph);\n// [ Set { 'e' }, Set { 'd' }, Set { 'b', 'c', 'a' } ]\n```\n\n#### Illustration of example input digraph\n```\n┌───┐     ┌───┐\n│ d │ ◀── │ a │ ◀┐\n└───┘     └───┘  │\n  │         │    │\n  ▼         ▼    │\n┌───┐     ┌───┐  │\n│ e │     │ c │  │\n└───┘     └───┘  │\n            │    │\n            ▼    │\n          ┌───┐  │\n          │ b │ ─┘\n          └───┘\n```\n","_attachments":{},"homepage":"https://github.com/rtsao/scc#readme","bugs":{"url":"https://github.com/rtsao/scc/issues"},"license":"MIT"}