/** * @see edu.uci.ics.jung.graph.Graph#getOutEdges(java.lang.Object) */ @Override public Collection<E> getOutEdges(V vertex) { return delegate.getOutEdges(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getOutEdges(java.lang.Object) */ public Collection<E> getOutEdges(V vertex) { return delegate.getOutEdges(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getOutEdges(java.lang.Object) */ @Override public synchronized Collection<E> getOutEdges(V vertex) { return delegate.getOutEdges(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getOutEdges(java.lang.Object) */ @Override public Collection<E> getOutEdges(V vertex) { return delegate.getOutEdges(vertex); }
@Override public Collection<E> getChildEdges(V vertex) { return delegate.getOutEdges(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getOutEdges(java.lang.Object) */ public synchronized Collection<E> getOutEdges(V vertex) { return delegate.getOutEdges(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getOutEdges(java.lang.Object) */ public Collection<E> getOutEdges(V vertex) { return delegate.getOutEdges(vertex); }
/** * Returns the outgoing edges of the vertex. * @param vertex The vertx * @return The collection of edges. */ public Collection getOutEdges(Object vertex) { return delegate.getOutEdges(vertex); }
public Collection<E> getChildEdges(V vertex) { return delegate.getOutEdges(vertex); }
public Collection<E> getOutEdges(V vertex) { return graph.getOutEdges(vertex); } public int getPredecessorCount(V vertex) {
/** * Returns the set of edges incident to <code>v</code> that should be * tested. By default, this is the set of outgoing edges for instances of * <code>Graph</code>, the set of incident edges for instances of * <code>Hypergraph</code>, and is otherwise undefined. */ protected Collection<E> getEdgesToCheck(V v) { if (g instanceof Graph) { return ((Graph<V, E>) g).getOutEdges(v); } return g.getIncidentEdges(v); }
@Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(V vertex) { try { // getOutEdges blueprints impl throws null pointer exception final Collection<E> outEdges = graph.getOutEdges(vertex); if (outEdges == null || outEdges.isEmpty()) { return Collections.emptyList(); } return adapt(outEdges); } catch (NullPointerException e){ return Collections.emptyList(); } }
/** * Returns the set of edges incident to <code>v</code> that should be tested. * By default, this is the set of outgoing edges for instances of <code>Graph</code>, * the set of incident edges for instances of <code>Hypergraph</code>, * and is otherwise undefined. */ protected Collection<E> getEdgesToCheck(V v) { if (g instanceof Graph) return ((Graph<V,E>)g).getOutEdges(v); else return g.getIncidentEdges(v); }
/** * Returns the set of edges incident to <code>v</code> that should be tested. * By default, this is the set of outgoing edges for instances of <code>Graph</code>, * the set of incident edges for instances of <code>Hypergraph</code>, * and is otherwise undefined. * @param v the vertex whose edges are to be checked * @return the set of edges incident to {@code v} that should be tested */ protected Collection<E> getEdgesToCheck(V v) { if (g instanceof Graph) return ((Graph<V,E>)g).getOutEdges(v); else return g.getIncidentEdges(v); }
protected void assignDefaultEdgeTransitionWeights() { for (V currentVertex : getVertices()) { Collection<E> outgoingEdges = mGraph.getOutEdges(currentVertex); double numOutEdges = outgoingEdges.size(); for (E currentEdge : outgoingEdges) { setEdgeWeight(currentEdge,1.0/numOutEdges); } } }
protected void assignDefaultEdgeTransitionWeights() { for (V currentVertex : getVertices()) { Collection<E> outgoingEdges = mGraph.getOutEdges(currentVertex); double numOutEdges = outgoingEdges.size(); for (E currentEdge : outgoingEdges) { setEdgeWeight(currentEdge,1.0/numOutEdges); } } }
protected void normalizeEdgeTransitionWeights() { for (V currentVertex : getVertices()) { Collection<E> outgoingEdges = mGraph.getOutEdges(currentVertex); double totalEdgeWeight = 0; for (E currentEdge : outgoingEdges) { totalEdgeWeight += getEdgeWeight(currentEdge); } for (E currentEdge : outgoingEdges) { setEdgeWeight(currentEdge,getEdgeWeight(currentEdge)/totalEdgeWeight); } } }
protected void normalizeEdgeTransitionWeights() { for (V currentVertex : getVertices()) { Collection<E> outgoingEdges = mGraph.getOutEdges(currentVertex); double totalEdgeWeight = 0; for (E currentEdge : outgoingEdges) { totalEdgeWeight += getEdgeWeight(currentEdge); } for (E currentEdge : outgoingEdges) { setEdgeWeight(currentEdge,getEdgeWeight(currentEdge)/totalEdgeWeight); } } }
/** Find and remove simple loops (e.g. a -> b -> a) from a Jung graph */ public static <V, E> void removeLoops(Graph<V, E> graph) { for (V v : graph.getVertices()) { for (E e : graph.getOutEdges(v)) { V dest = graph.getDest(e); E returnEdge = graph.findEdge(dest, v); if (returnEdge != null) { LOGGER.warn( "Loop detected between {} and {}. Original order will be preserved.", getName(v), getName(dest)); graph.removeEdge(returnEdge); } } } }
/** Find and remove simple loops (e.g. a -> b -> a) from a Jung graph */ public static <V, E> void removeLoops(Graph<V, E> graph) { for (V v : graph.getVertices()) { for (E e : graph.getOutEdges(v)) { V dest = graph.getDest(e); E returnEdge = graph.findEdge(dest, v); if (returnEdge != null) { LOGGER.warn( "Loop detected between {} and {}. Original order will be preserved.", getName(v), getName(dest)); graph.removeEdge(returnEdge); } } } }