/** * Returns the diameter of <code>g</code>, ignoring edge weights. * * @see #diameter(Hypergraph, Distance, boolean) */ public static <V, E> double diameter(Hypergraph<V, E> g) { return diameter(g, new UnweightedShortestPath<V, E>(g)); }
/** * Equivalent to <code>this(graph, averaging, true, true)</code>. * * @param graph The graph on which the node scores are to be calculated. * @param averaging Specifies whether the values returned is the sum of all v-distances or the * mean v-distance. */ public DistanceCentralityScorer(Graph<N> graph, boolean averaging) { this(graph, new UnweightedShortestPath<N>(graph), averaging, true, true); }
@Override public synchronized void clearMaxThroughput() { if (mtp != null) { mtp.reset(); // reset max throughput path } }
/** * To calculate the shortest path from lrs (source router) to lrd (destination) * @param lrs - source router identifier. * @param lrd - destination router identifier. * @param topo - topology * @return the links constructing the path. */ private List<Link> calcShortestPath(NodeId nodes, NodeId noded, Graph<NodeId, Link> graph) { DijkstraShortestPath<NodeId, Link> alg = new DijkstraShortestPath<>(graph); return alg.getPath(nodes, noded); }
/** * Returns a <code>List</code> of the edges on the shortest path from * <code>source</code> to <code>target</code>, in order of their * occurrence on this path. * If either vertex is not in the graph for which this instance * was created, throws <code>IllegalArgumentException</code>. */ public List<E> getPath(V source, V target) { return getPath(source,target, true); }
/** This constructor allows to configure if the shortest-path algorithm should cached previous computations. * * @param graph Graph on which shortest paths are searched * @param nev The class responsible for returning weights for edges * @param cached Indicates whether previous computations from the shortest-path algorithm should be cached */ private SuurballeTarjanAlgorithm(Graph<V, E> graph, Transformer<E, Double> nev, boolean cached) { this.graph = graph; this.nev = nev; this.cached = cached; dijkstra = new DijkstraShortestPath<V, E>(graph, nev, cached); }
/** * Equivalent to <code>this(graph, edge_weights, averaging, true, true)</code>. * * @param graph The graph on which the node scores are to be calculated. * @param edge_weights The edge weights to use for specifying the distance between pairs of nodes. * @param averaging Specifies whether the values returned is the sum of all v-distances or the * mean v-distance. */ public DistanceCentralityScorer( Network<N, E> graph, Function<E, ? extends Number> edge_weights, boolean averaging) { this(graph, new DijkstraDistance<N, E>(graph, edge_weights), averaging, true, true); }
/** * Returns the diameter of <code>g</code> using the metric specified by * <code>d</code>. The diameter is defined to be the maximum, over all pairs * of vertices <code>u,v</code>, of the length of the shortest path from * <code>u</code> to <code>v</code>, or * <code>Double.POSITIVE_INFINITY</code> if any of these distances do not * exist. * * @see #diameter(Hypergraph, Distance, boolean) */ public static <V, E> double diameter(Hypergraph<V, E> g, Distance<V> d) { return diameter(g, d, false); }
/** * Returns the diameter of <code>g</code>, ignoring edge weights. * @see #diameter(Hypergraph, Distance, boolean) */ public static <V, E> double diameter(Hypergraph<V,E> g) { return diameter(g, new UnweightedShortestPath<V,E>(g)); }
/** * Equivalent to <code>this(graph, averaging, true, true)</code>. * @param graph The graph on which the vertex scores are to be * calculated. * @param averaging Specifies whether the values returned is the sum of * all v-distances or the mean v-distance. */ public DistanceCentralityScorer(Hypergraph<V,E> graph, boolean averaging) { this(graph, new UnweightedShortestPath<V,E>(graph), averaging, true, true); }
/** * Returns a <code>List</code> of the edges on the Max Througput Shortest * path from <code>source</code> to <code>target</code>, in order of their * their occurrence on this path. * Important - Transformer fn should return the appropriate edge weight * for this API to return the Path Correctly. * If either vertex is not in the graph for which this instance * was created, throws <code>IllegalArgumentException</code>. */ public List<E> getMaxThroughputPath(V source, V target) { return getPath(source,target, false); }
public SuurballeAlgorithm(Graph<V,E> graph) { this.graph = graph; this.dijkstraAlgorithm = new DijkstraShortestPath<>(graph, defaultEdgeWeight, true); }
/** * Returns the diameter of <code>g</code>, ignoring edge weights. * * @see #diameter(Graph, BiFunction, boolean) * @param g the graph for which distances are to be calculated * @param <N> the node type * @return the longest distance from any node to any other */ public static <N> double diameter(Graph<N> g) { return diameter(g, new UnweightedShortestPath<N>(g)::getDistance); } }
/** * Equivalent to <code>this(graph, averaging, true, true)</code>. * @param graph The graph on which the vertex scores are to be * calculated. * @param averaging Specifies whether the values returned is the sum of * all v-distances or the mean v-distance. */ public DistanceCentralityScorer(Hypergraph<V,E> graph, boolean averaging) { this(graph, new UnweightedShortestPath<V,E>(graph), averaging, true, true); }
/** * Returns a list of Network-Topology Links * that represents the Dijkstra's algorithm * shortest path between a source and target * OF Node. * @param source Network-Topology Node * @param target Network-Topology Node * @return links Dijkstra Shortest Path */ @Override public final List<Link> getShortestPath(NodeId source, NodeId target) { return shortestPath.getPath(source, target); }
/** * Returns the diameter of <code>g</code>, ignoring edge weights. * @see #diameter(Hypergraph, Distance, boolean) * * @param g the graph for which distances are to be calculated * @param <V> the vertex type * @param <E> the edge type * @return the longest distance from any vertex to any other */ public static <V, E> double diameter(Hypergraph<V,E> g) { return diameter(g, new UnweightedShortestPath<V,E>(g)); } }
/** * Initialises unit distance measure. * * @param viewer * OVTK2PropertiesAggregator */ public AttributeKKLayout(OVTK2PropertiesAggregator viewer) { super(viewer); this.distance = new UnweightedShortestPath<ONDEXConcept, ONDEXRelation>( graph); }
/** * Creates an instance for the specified graph. */ public KKLayout(Graph<V,E> g) { this(g, new UnweightedShortestPath<V,E>(g)); }
/** * Equivalent to <code>this(graph, averaging, true, true)</code>. * * @param graph * The graph on which the vertex scores are to be calculated. * @param averaging * Specifies whether the values returned is the sum of all * v-distances or the mean v-distance. */ public DistanceCentralityScorer(Hypergraph<V, E> graph, boolean averaging) { this(graph, new UnweightedShortestPath<V, E>(graph), averaging, true, true); }
public KKLayout(Graph<V,E> g) { this(g, new UnweightedShortestPath<V,E>(g)); }