src/main/java/de/dfki/lt/loot/digraph/algo/TransitiveClosure.java
private static <EdgeInfo> void dfsVisit(DiGraph<EdgeInfo> graph,
      VertexPropertyMap<Set<Integer>> closure, int vertex) {
    Set<Integer> myClosure = new HashSet<Integer>();
    closure.put(vertex, myClosure);

    for (Edge<EdgeInfo> edge : graph.getOutEdges(vertex)) {
      int target = edge.getTarget();
      // is the target vertex white?
      if (closure.get(target) == null) {
        dfsVisit(graph, closure, target);
      }
      myClosure.add(target);
      myClosure.addAll(closure.get(target));
    }
  }
/** Recursive helper function for the acyclicClosure method */
Recursive helper function for the acyclicClosure method
Recursive helper function for the acyclicClosure method
private static <EdgeInfo> void dfsVisit(DiGraph<EdgeInfo> graph,
      VertexPropertyMap<Set<Integer>> closure, int vertex) {
    Set<Integer> myClosure = new HashSet<Integer>();
    closure.put(vertex, myClosure);
    for (Edge<EdgeInfo> edge : graph.getOutEdges(vertex)) {
      int target = edge.getTarget();
      if (closure.get(target) == null) {
        dfsVisit(graph, closure, target);
      }
      myClosure.add(target);
      myClosure.addAll(closure.get(target));
    }
  }
private static < EdgeInfo > void dfsVisit ( DiGraph < EdgeInfo > graph , VertexPropertyMap < Set < Integer > > closure , int vertex ) { Set < Integer > myClosure = new HashSet < Integer > ( ) ; closure . put ( vertex , myClosure ) ; for ( Edge < EdgeInfo > edge : graph . getOutEdges ( vertex ) ) { int target = edge . getTarget ( ) ; if ( closure . get ( target ) == null ) { dfsVisit ( graph , closure , target ) ; } myClosure . add ( target ) ; myClosure . addAll ( closure . get ( target ) ) ; } }
Recursive helper function for the acyclicClosure method
Recursive helper function for the acyclicClosure method
// is the target vertex white?