src/main/java/de/dfki/lt/loot/digraph/algo/TransitiveClosure.java
public static <EdgeInfo> VertexPropertyMap<Set<Integer>>
  acyclicClosure(DiGraph<EdgeInfo> graph) {
    VertexPropertyMap<Set<Integer>> closure =
        new VertexListPropertyMap<Set<Integer>>(graph);
    for(int vertex = 0; vertex < graph.getNumberOfVertices(); ++vertex) {
      if (! graph.isDeletedVertex(vertex) && closure.get(vertex) == null) {
        dfsVisit(graph, closure, vertex);
      }
    }
    return closure;
  }
/** Transitive closure on an acyclic graph, implemented with DFS.
   *  @return the closure as VertexPropertyMap, mapping each vertex to all its
   *          reachable nodes.
   */
Transitive closure on an acyclic graph, implemented with DFS.
@return the closure as VertexPropertyMap, mapping each vertex to all its
reachable nodes.
Transitive closure on an acyclic graph implemented with DFS . @return the closure as VertexPropertyMap mapping each vertex to all its reachable nodes .
public static <EdgeInfo> VertexPropertyMap<Set<Integer>>
  acyclicClosure(DiGraph<EdgeInfo> graph) {
    VertexPropertyMap<Set<Integer>> closure =
        new VertexListPropertyMap<Set<Integer>>(graph);
    for(int vertex = 0; vertex < graph.getNumberOfVertices(); ++vertex) {
      if (! graph.isDeletedVertex(vertex) && closure.get(vertex) == null) {
        dfsVisit(graph, closure, vertex);
      }
    }
    return closure;
  }
public static < EdgeInfo > VertexPropertyMap < Set < Integer > > acyclicClosure ( DiGraph < EdgeInfo > graph ) { VertexPropertyMap < Set < Integer > > closure = new VertexListPropertyMap < Set < Integer > > ( graph ) ; for ( int vertex = 0 ; vertex < graph . getNumberOfVertices ( ) ; ++ vertex ) { if ( ! graph . isDeletedVertex ( vertex ) && closure . get ( vertex ) == null ) { dfsVisit ( graph , closure , vertex ) ; } } return closure ; }
Transitive closure on an acyclic graph, implemented with DFS.
Transitive closure on an acyclic graph implemented with DFS .