https://github.com/triska/scc
Strongly Connected Components of a Graph
https://github.com/triska/scc
graph prolog scc tarjan-algorithm
Last synced: 3 months ago
JSON representation
Strongly Connected Components of a Graph
- Host: GitHub
- URL: https://github.com/triska/scc
- Owner: triska
- Created: 2014-10-07T05:50:19.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-04-13T22:15:23.000Z (almost 6 years ago)
- Last Synced: 2025-01-25T08:09:30.743Z (about 1 year ago)
- Topics: graph, prolog, scc, tarjan-algorithm
- Language: Prolog
- Homepage: https://www.metalevel.at/scc.pl
- Size: 4.88 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Relation between a graph and its Strongly Connected Components (SCCs).
Usage:
nodes_arcs_sccs(+Ns, +As, -SCCs)
where:
* `Ns` is a list of nodes. Each node must be a ground term.
* `As` is a list of `arc(From,To)` terms where `From` and `To` are nodes.
* `SCCs` is a list of lists of nodes that are in the same strongly
connected component.
Running time is `O(|V| + log(|V|)*|E|)`.
Example:
```
?- nodes_arcs_sccs([a,b,c,d], [arc(a,b),arc(b,a),arc(b,c)], SCCs).
SCCs = [[a,b],[c],[d]].
```