use of org.jgrapht.alg.StrongConnectivityInspector in project graal by graphik-team.
the class GraphPositionDependencies method initFiniteRank.
public void initFiniteRank() {
if (this.isFiniteRank == null) {
this.isFiniteRank = new TreeSet<PredicatePosition>();
StrongConnectivityInspector<PredicatePosition, DefaultEdge> sccInspector = new StrongConnectivityInspector<PredicatePosition, DefaultEdge>(graph);
List<Set<PredicatePosition>> sccList = sccInspector.stronglyConnectedSets();
for (Set<PredicatePosition> scc : sccList) {
boolean componentIsFiniteRank = true;
for (PredicatePosition p1 : scc) {
for (PredicatePosition p2 : scc) {
for (DefaultEdge edge : graph.getAllEdges(p1, p2)) {
if (edge instanceof SpecialEdge) {
componentIsFiniteRank = false;
}
}
}
}
// store information
if (componentIsFiniteRank) {
for (PredicatePosition p : scc) {
this.isFiniteRank.add(p);
}
}
}
}
}
Aggregations