/** * @return Transform a set of {@link TopologySpec} into a instance of {@link org.jgrapht.graph.WeightedMultigraph} * and filter out connections between blacklisted vertices that user specified. * The output of this function only stays in memory, so each time a logical flow is compiled, the multigraph will * be re-calculated. * */ private void inMemoryWeightGraphGenerator() { for (TopologySpec topologySpec : topologySpecMap.values()) { weightGraphGenerateHelper(topologySpec); } // Filter out connection appearing in servicePolicy. // This is where servicePolicy is enforced. servicePolicy.populateBlackListedEdges(this.weightedGraph); if (servicePolicy.getBlacklistedEdges().size() > 0) { for (FlowEdge toDeletedEdge : servicePolicy.getBlacklistedEdges()) { weightedGraph.removeEdge(toDeletedEdge); } } }
public void removeEdge(Representation startVertex, Representation endVertex) { this.mConvertFunctionFactory.remove(startVertex, endVertex); this.mGraph.removeEdge(startVertex, endVertex); }
/** * This method just deletes the specified link from the graph and leaves the rest of the graph untouched. * @param linkId * @return */ public boolean removeLink(String linkId) { LabeledLink link = this.getLinkById(linkId); if (link != null) { // return this.graphBuilder.removeLink(link); if (this.graphBuilder.removeLink(link)) if (this.steinerTree != null) { this.steinerTree.removeEdge(link); return true; } } logger.debug("Cannot find the link " + linkId + " in the graph."); return false; }
/** * @return Transform a set of {@link TopologySpec} into a instance of {@link org.jgrapht.graph.WeightedMultigraph} * and filter out connections between blacklisted vertices that user specified. * The output of this function only stays in memory, so each time a logical flow is compiled, the multigraph will * be re-calculated. * */ private void inMemoryWeightGraphGenerator() { for (TopologySpec topologySpec : topologySpecMap.values()) { weightGraphGenerateHelper(topologySpec); } // Filter out connection appearing in servicePolicy. // This is where servicePolicy is enforced. servicePolicy.populateBlackListedEdges(this.weightedGraph); if (servicePolicy.getBlacklistedEdges().size() > 0) { for (FlowEdge toDeletedEdge : servicePolicy.getBlacklistedEdges()) { weightedGraph.removeEdge(toDeletedEdge); } } }
if (!this.graph.removeEdge(link)) return false;
tree.removeEdge(inLink); tree.addEdge(target, source, reverseLink); tree.setEdgeWeight(reverseLink, inLink.getWeight()); target = outLink.getTarget(); if (visitedNodes.contains(target)) { tree.removeEdge(outLink); removedLinks.add(outLink.getId()); } else {
tree.removeEdge(link); if (allowedChangingGraph) this.graphBuilder.removeLink(link);
this.graphBuilder.getGraph().removeEdge(link);