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); }
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); }
/** 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;
final Map<List, MutableNode> nodesByParent = new HashMap<>(); final List<MutableNode> rootNodes = new ArrayList<>(); for (TableRef tableRef : TopologicalOrderIterator.of(g)) { final List<StepRef> edges = g.getInwardEdges(tableRef); final MutableNode node;