private static Map<Group, Integer> getGroupParallelisms(DirectedGraph<Node, IndexedEdge> graph, GraphGrouper grouper, Collection<Group> groups) { UndirectedGraph<Group, Object> equivs = new Pseudograph<>(Object.class); for(Group g: groups) { equivs.addVertex(g);
new Pseudograph<>(DefaultLink.class); g.addVertex(n); continue; if (g.containsEdge(n1, n2)) continue; g.addEdge(n1, n2, e); g.setEdgeWeight(e, path.getCost(n2));
/** * Create a builder for this kind of graph. * * @param edgeClass class on which to base factory for edges * @param <V> the graph vertex type * @param <E> the graph edge type * @return a builder for this kind of graph */ public static <V, E> GraphBuilder<V, E, ? extends Pseudograph<V, E>> createBuilder( Class<? extends E> edgeClass) { return new GraphBuilder<>(new Pseudograph<>(edgeClass)); }
/** * Create a builder for this kind of graph. * * @param edgeSupplier the edge supplier of the new graph * @param <V> the graph vertex type * @param <E> the graph edge type * @return a builder for this kind of graph */ public static <V, E> GraphBuilder<V, E, ? extends Pseudograph<V, E>> createBuilder(Supplier<E> edgeSupplier) { return new GraphBuilder<>(new Pseudograph<>(null, edgeSupplier, false)); }
private UndirectedGraph<String, Object> graphSubstationsTransformers() { UndirectedGraph<String, Object> graph = new Pseudograph<>(Object.class); for (PropertyBag s : context.cgmes().substations()) { String id = s.getId(CgmesNames.SUBSTATION); graph.addVertex(context.namingStrategy().getId(CgmesNames.SUBSTATION, id)); } for (PropertyBags tends : context.cgmes().groupedTransformerEnds().values()) { List<String> substationsIds = substationsIds(tends); if (substationsIds.size() > 1) { for (int i = 1; i < substationsIds.size(); i++) { graph.addEdge(substationsIds.get(0), substationsIds.get(i)); } } } return graph; }
new Pseudograph<Object, DefaultEdge>(DefaultEdge.class); Object prev; Object curr;
Graph<V, DefaultEdge> mstAndMatching = new Pseudograph<>(DefaultEdge.class); graph.vertexSet().forEach(mstAndMatching::addVertex);
private UndirectedGraph<UcteNodeCode, Object> createSubstationGraph(UcteNetwork network) { UndirectedGraph<UcteNodeCode, Object> graph = new Pseudograph<>(Object.class); for (UcteNode node : network.getNodes()) { graph.addVertex(node.getCode()); } // in the same substation... addEdgeBetweenSameGeographicalSpotNodes(network, graph); addEdgeBetweenTransformers(network, graph); addEdgeForCouplerOrLowImpedanceLine(network, graph); return graph; }
private static Map<Group, Integer> getGroupParallelisms(DirectedGraph<Node, IndexedEdge> graph, GraphGrouper grouper, Collection<Group> groups) { UndirectedGraph<Group, Object> equivs = new Pseudograph<Group, Object>(Object.class); for(Group g: groups) { equivs.addVertex(g);
private UndirectedGraph<Vertex, Object> createGraph() { UndirectedGraph<Vertex, Object> graph = new Pseudograph<>(Object.class);
Graph<V, E> eulerGraph = new Pseudograph<>( graph.getVertexSupplier(), graph.getEdgeSupplier(), graph.getType().isWeighted()); Graphs.addGraph(eulerGraph, graph);
UndirectedGraph<String, Object> graph = new Pseudograph<>(Object.class); for (cim1.model.Substation s : cimModel.getId_Substation().values()) { graph.addVertex(namingStrategy.getId(s));
return new WeightedPseudograph<>(vertexSupplier, edgeSupplier); } else { return new Pseudograph<>(vertexSupplier, edgeSupplier, false);
return new WeightedPseudograph<>(edgeClass); } else { return new Pseudograph<>(edgeClass);