/** * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object) */ @Override public synchronized V getSource(E directed_edge) { return delegate.getSource(directed_edge); }
/** * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object) */ public V getSource(E directed_edge) { return delegate.getSource(directed_edge); }
/** * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object) */ public V getSource(E directed_edge) { return delegate.getSource(directed_edge); }
/** * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object) */ @Override public V getSource(E directed_edge) { return delegate.getSource(directed_edge); }
/** * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object) */ @Override public V getSource(E directed_edge) { return delegate.getSource(directed_edge); }
/** * Returns the source of a directed edge. * @param directed_edge The edge. * @return The vertex. */ public Object getSource(Object directed_edge) { return delegate.getSource(directed_edge); }
/** * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object) */ public synchronized V getSource(E directed_edge) { return delegate.getSource(directed_edge); }
public V getSource(E directedEdge) { return graph.getSource(directedEdge); } public int getSuccessorCount(V vertex) {
private void discardCommonReversedEdges(final Graph<V,E> graph, final List<E> path1, final List<E> path2) { if (path1.size() == 0 || path2.size() == 0){ return; } else { final V source = graph.getSource(path1.get(0)); final V target = graph.getDest(path1.get(path1.size() - 1)); for(final E edge2 : path2){ for(final E edge1 : path1){ if (edge1.equals(edge2)){ if (graph.isSource(source, edge1) || graph.isSource(source, edge2) || graph.isDest(target, edge1) || graph.isDest(target, edge2)){ // Return only shortest path path2.clear(); return; } path1.remove(edge1); path2.remove(edge2); break; } } } } }
for (E e2 : graph.getIncidentEdges(graph.getSource(e)))
cluster.addEdge(edge, original.getSource(edge), original.getDest(edge));
/** This method does the following length transformation: * * <pre> c'(v,w) = c(v,w) - d (s,w) + d (s,v) </pre> * * @param graph1 the graph * @param slTrans The shortest length transformer * @return the transformed graph * @since 0.3.0 */ private Transformer<E, Double> lengthTransformation(Graph<V, E> graph1, Transformer<V, Number> slTrans) { SortedMap<E, Double> map = new TreeMap<E, Double>(); for (E link : graph1.getEdges()) { double newWeight; if (slTrans.transform(graph1.getSource(link)) == null) { newWeight = Double.MAX_VALUE; } else { newWeight = nev.transform(link) - slTrans.transform(graph1.getDest(link)).doubleValue() + slTrans.transform(graph1.getSource(link)).doubleValue(); if (newWeight < 0 || newWeight > -1e-6) newWeight = 0; /* Numerical errors */ } map.put(link, newWeight); } return MapTransformer.getInstance(map); } }
protected List<E> reverseUpdateEdgesWeight(final Graph<V, E> graph, final Transformer<V, Number> transformer, final List<E> shortestPath, final V initial, final V destination) { for(final E edge1 : shortestPath){ V src = graph.getSource(edge1); V dst = graph.getDest(edge1); graph.removeEdge(edge1); graph.addEdge(edge1, dst, src, EdgeType.DIRECTED); } final List<E> edges = new ArrayList<>(graph.getEdges()); final Map<E, Number> map = new LinkedHashMap<>(); edges.forEach(edge -> { final V source = graph.getSource(edge); final V dest = graph.getDest(edge); Number cost = calculateCost(transformer, edge, source, dest); map.put(edge,cost); }); final DijkstraShortestPath<V, E> reversedDijkstra = new DijkstraShortestPath<>(graph, MapTransformer.getInstance(map)); DijkstraShortestPath<V, E> validatedShortestPath = checkPath(initial, destination, reversedDijkstra); return validatedShortestPath != null ? reversedDijkstra.getPath(initial, destination) : new ArrayList<>(); }
ONDEXConcept source = graph.getSource(edge); ONDEXConcept dest = graph.getDest(edge);
graph.getSource(edge)); Point2D dest = viewer.getGraphLayout().transform(graph.getDest(edge)); xmlw.writeStartElement("y:Point");
V source = graph.getSource(e); V dest = graph.getDest(e); E to_add = create_new ? edge_factory.get() : e;
/** This method reverse the path "path" in the graph "graph" and returns it. * * @param graph the input graph which will not be changed. * @param path the path to reverse * @return a new graph with the reversed path * @since 0.3.0 */ private static <V, E> Graph<V, E> reverseEdges(Graph<V, E> graph, List<E> path) { if (graph == null || path == null) throw new IllegalArgumentException(); Graph<V, E> clone = new DirectedOrderedSparseMultigraph<V, E>(); for (V v : graph.getVertices()) clone.addVertex(v); for (E e : graph.getEdges()) clone.addEdge(e, graph.getEndpoints(e)); for (E link : path) { V src = clone.getSource(link); V dst = clone.getDest(link); clone.removeEdge(link); clone.addEdge(link, dst, src, EdgeType.DIRECTED); } return clone; }
Node originNode_thisLink = originalNodeId2AuxIdMapping.get(graph.getSource(edge)); Node destinationNode_thisLink = graph.getDest(edge); auxGraph.addEdge(edge, originNode_thisLink, destinationNode_thisLink);
V source = graph.getSource(e); V dest = graph.getDest(e); E to_add = create_new ? edge_factory.create() : e;
} else // if the edge is directed, just add it V source = graph.getSource(e); V dest = graph.getDest(e); E to_add = create_new ? edge_factory.create() : e;