/** * 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> using the metric specified by <code>d</code>. The * diameter is defined to be the maximum, over all pairs of nodes <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(Graph, BiFunction, boolean) * @param g the graph for which distances are to be calculated * @param distance the distance metric to use for the calculation * @param <N> the node type * @return the longest distance from any node to any other */ public static <N> double diameter(Graph<N> g, BiFunction<N, N, ? extends Number> distance) { return diameter(g, distance, false); }
/** * 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> 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) * * @param g the graph for which distances are to be calculated * @param d the distance metric to use for the calculation * @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, 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)); }
/** * 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)); }
/** * 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); } }
/** * 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)); } }
diameter = DistanceStatistics.<V,E>diameter(graph, distance, true);
diameter = DistanceStatistics.<V,E>diameter(graph, distance, true);
diameter = DistanceStatistics.<N>diameter(graph, distance, true);