strongly-connected-components

WebJar for strongly-connected-components

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

strongly-connected-components
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

strongly-connected-components
WebJar for strongly-connected-components
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/strongly-connected-components

Download strongly-connected-components

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/strongly-connected-components/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>strongly-connected-components</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/strongly-connected-components/
implementation 'org.webjars.npm:strongly-connected-components:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/strongly-connected-components/
implementation ("org.webjars.npm:strongly-connected-components:1.0.1")
'org.webjars.npm:strongly-connected-components:jar:1.0.1'
<dependency org="org.webjars.npm" name="strongly-connected-components" rev="1.0.1">
  <artifact name="strongly-connected-components" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='strongly-connected-components', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "strongly-connected-components" % "1.0.1"
[org.webjars.npm/strongly-connected-components "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

strongly-connected-components

Given a directed graph, splits it into strongly connected components.

Example

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.

Versions

Version
1.0.1