项目作者: triska

项目描述 :
Strongly Connected Components of a Graph
高级语言: Prolog
项目地址: git://github.com/triska/scc.git
创建时间: 2014-10-07T05:50:19Z
项目社区:https://github.com/triska/scc

开源协议:

下载


Relation between a graph and its Strongly Connected Components (SCCs).

Usage:

  1. 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:

  1. ?- nodes_arcs_sccs([a,b,c,d], [arc(a,b),arc(b,a),arc(b,c)], SCCs).
  2. SCCs = [[a,b],[c],[d]].