/** * @see edu.uci.ics.jung.graph.Hypergraph#getVertices() */ public synchronized Collection<V> getVertices() { return delegate.getVertices(); }
/** * @see edu.uci.ics.jung.graph.Hypergraph#getVertices() */ @Override public synchronized Collection<V> getVertices() { return delegate.getVertices(); }
/** * @see edu.uci.ics.jung.graph.Hypergraph#getVertices() */ @Override public Collection<V> getVertices() { return delegate.getVertices(); }
/** * @see edu.uci.ics.jung.graph.Hypergraph#getVertices() */ @Override public Collection<V> getVertices() { return delegate.getVertices(); }
/** * Returns all vertices of the graph. * @return The collection of vertices. */ public Collection getVertices() { return delegate.getVertices(); }
/** * @see edu.uci.ics.jung.graph.Hypergraph#getVertices() */ public Collection<V> getVertices() { return delegate.getVertices(); }
private Set<V> getRoots() { Set<V> roots = graph.getVertices().stream() .filter(v -> graph.getInEdges(v).isEmpty()) // Preserve the order of the roots .collect(Collectors.toCollection(LinkedHashSet::new)); return roots; }
/** * Returns the root of each tree of this forest as a {@code Collection}. */ public Collection<V> getRoots() { Collection<V> roots = new HashSet<V>(); for (V v : delegate.getVertices()) { if (delegate.getPredecessorCount(v) == 0) { roots.add(v); } } return roots; }
protected void initialize(Graph<V, E> graph) { this.graph = graph; this.vertex_scores = new HashMap<V, Double>(); this.edge_scores = new HashMap<E, Double>(); this.vertex_data = new HashMap<V, BetweennessData>(); for (V v : graph.getVertices()) { this.vertex_scores.put(v, 0.0); } for (E e : graph.getEdges()) { this.edge_scores.put(e, 0.0); } }
/** * @return the root of each tree of this forest as a {@code Collection}. */ public Collection<V> getRoots() { Collection<V> roots = new HashSet<V>(); for(V v : delegate.getVertices()) { if(delegate.getPredecessorCount(v) == 0) { roots.add(v); } } return roots; }
/** * Creates an instance for the specified graph and alpha (random jump probability) * parameter. The edge weights are all set to 1. * @param g the input graph * @param alpha the probability of a hub giving some authority to all vertices, * and of an authority increasing the score of all hubs (not just those connected * via links) */ public HITS(Graph<V,E> g, double alpha) { super(g, ScoringUtils.getHITSUniformRootPrior(g.getVertices()), alpha); }
protected void initialize(Graph<V,E> graph) { this.graph = graph; this.vertex_scores = new HashMap<V, Double>(); this.edge_scores = new HashMap<E, Double>(); this.vertex_data = new HashMap<V, BetweennessData>(); for (V v : graph.getVertices()) this.vertex_scores.put(v, 0.0); for (E e : graph.getEdges()) this.edge_scores.put(e, 0.0); }
/** * Sets the order of the vertices in the layout according to the ordering * specified by {@code comparator}. */ public void setVertexOrder(Comparator<V> comparator) { if (vertex_ordered_list == null) vertex_ordered_list = new ArrayList<V>(getGraph().getVertices()); Collections.sort(vertex_ordered_list, comparator); }
/** * Sets the order of the vertices in the layout according to the ordering * of {@code vertex_list}. */ public void setVertexOrder(List<V> vertex_list) { if (!vertex_list.containsAll(getGraph().getVertices())) throw new IllegalArgumentException("Supplied list must include " + "all vertices of the graph"); this.vertex_ordered_list = vertex_list; }
/** * Locks all vertices in place if {@code lock} is {@code true}, otherwise unlocks all vertices. */ public void lock(boolean lock) { for(V v : graph.getVertices()) { lock(v, lock); } } }
@Override public boolean done() { return // if we have no objects in our graph to layout we are done: (getGraph().getEdges().isEmpty() && getGraph().getVertices().isEmpty()) || m_alpha < 0.005; }
private void cleanUp() { vertices.clear(); edges.clear(); for(V v : graph.getVertices()) { checkVertex(v); } for(E e : graph.getEdges()) { checkEdge(e); } }
/** * This method calls <tt>initialize_local_vertex</tt> for each vertex, and * also adds initial coordinate information for each vertex. (The vertex's * initial location is set by calling <tt>initializeLocation</tt>. */ protected void initializeLocations() { for(V v : getGraph().getVertices()) { Point2D coord = delegate.apply(v); if (!dontmove.contains(v)) initializeLocation(v, coord); } }
/** * create an instance with a passed layout * create containers for graph components * @param layout the layout whose positions are to be persisted */ public PersistentLayoutImpl(Layout<V,E> layout) { super(layout); this.locations = Maps.asMap( ImmutableSet.copyOf(layout.getGraph().getVertices()), new RandomPointFactory<V>(getSize())); this.dontmove = new HashSet<V>(); }
@Override public void setSize(Dimension size) { super.setSize(size); for(V v : getGraph().getVertices()) { initializeLocation(v,apply(v),getSize()); } }