public Set<V> findCycles() { return new TopologicalOrderIterator<>(graph).findCycles(); } }
public TopologicalOrderIterator(DirectedGraph<V, E> graph) { this.graph = (DefaultDirectedGraph<V, E>) graph; populate(countMap, empties); }
private List<Integer> getRank(DirectedGraph<Integer, DefaultEdge> graph) { final int[] rankArr = new int[graph.vertexSet().size()]; int rank = 0; for (int i : TopologicalOrderIterator.of(graph)) { rankArr[i] = rank++; } return ImmutableIntList.of(rankArr); }
new TopologicalOrderIterator<>(graph); final List<Integer> permutation = new ArrayList<>(); while (iter.hasNext()) { permutation.add(iter.next());
public static <V, E extends DefaultEdge> Iterable<V> of( final DirectedGraph<V, E> graph) { return () -> new TopologicalOrderIterator<>(graph); }
private List<Integer> getRank(DirectedGraph<Integer, DefaultEdge> graph) { final int[] rankArr = new int[graph.vertexSet().size()]; int rank = 0; for (int i : TopologicalOrderIterator.of(graph)) { rankArr[i] = rank++; } return ImmutableIntList.of(rankArr); }
new TopologicalOrderIterator<>(graph); final List<Integer> permutation = new ArrayList<>(); while (iter.hasNext()) { permutation.add(iter.next());
public static <V, E extends DefaultEdge> Iterable<V> of( final DirectedGraph<V, E> graph) { return () -> new TopologicalOrderIterator<>(graph); }
public Set<V> findCycles() { return new TopologicalOrderIterator<>(graph).findCycles(); } }
public TopologicalOrderIterator(DirectedGraph<V, E> graph) { this.graph = (DefaultDirectedGraph<V, E>) graph; populate(countMap, empties); }
/** Unit test for {@link TopologicalOrderIterator}. */ @Test public void testTopologicalOrderIterator() { final DefaultDirectedGraph<String, DefaultEdge> graph = createDag(); final List<String> list = new ArrayList<String>(); for (String s : TopologicalOrderIterator.of(graph)) { list.add(s); } assertEquals("[A, B, E, C, F, D]", list.toString()); }
/** Unit test for {@link TopologicalOrderIterator}. */ @Test public void testTopologicalOrderIterator() { final DefaultDirectedGraph<String, DefaultEdge> graph = createDag(); final List<String> list = new ArrayList<String>(); for (String s : TopologicalOrderIterator.of(graph)) { list.add(s); } assertEquals("[A, B, E, C, F, D]", list.toString()); }
final Map<RelNode, Node> map = new IdentityHashMap<>(); int previousColumn = 0; for (RelNode relNode : TopologicalOrderIterator.of(graph)) { final List<Edge> edges = graph.getInwardEdges(relNode); Node node;
final List<RelOptMaterialization> applicableMaterializations = new ArrayList<>(); for (List<String> qname : TopologicalOrderIterator.of(usesGraph)) { RelOptMaterialization materialization = qnameMap.get(qname); if (materialization != null
final List<RelOptMaterialization> applicableMaterializations = new ArrayList<>(); for (List<String> qname : TopologicalOrderIterator.of(usesGraph)) { RelOptMaterialization materialization = qnameMap.get(qname); if (materialization != null
for (Vertex vertex : TopologicalOrderIterator.of(graph)) { final List<Edge> edges = graph.getInwardEdges(vertex); MutableNode node;