/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * Initialises unit distance measure. * * @param viewer * OVTK2PropertiesAggregator */ public AttributeKKLayout(OVTK2PropertiesAggregator viewer) { super(viewer); this.distance = new UnweightedShortestPath<ONDEXConcept, ONDEXRelation>( graph); }
public KKLayout(Graph<V,E> g) { this(g, new UnweightedShortestPath<V,E>(g)); }
/** * Creates an instance with the specified graph and averaging behavior * whose vertex distances are calculated on the unweighted graph. * * @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. * @param ignore_missing Specifies whether scores for missing distances * are to ignore missing distances or be set to null. * @param ignore_self_distances Specifies whether distances from a vertex * to itself should be included in its score. */ public DistanceCentralityScorer(Hypergraph<V,E> graph, boolean averaging, boolean ignore_missing, boolean ignore_self_distances) { this(graph, new UnweightedShortestPath<V,E>(graph), averaging, ignore_missing, ignore_self_distances); }
/** * 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); } }
public PackageDistanceAnalyser( final DirectedGraph<ElementName, Integer> packageNameGraph) { this.usp = new UnweightedShortestPath<ElementName, Integer>( makeNonDirectional(packageNameGraph)); }
/** * 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)); }
public PackageDistanceAnalyser( final DirectedGraph<ElementName, Integer> packageNameGraph) { this.usp = new UnweightedShortestPath<ElementName, Integer>( makeNonDirectional(packageNameGraph)); }
public PackageDistanceAnalyser( final DirectedGraph<ElementName, Integer> packageNameGraph) { this.usp = new UnweightedShortestPath<ElementName, Integer>( makeNonDirectional(packageNameGraph)); }
/** * For each vertex <code>v</code> in <code>g</code>, calculates the average * shortest path length from <code>v</code> to all other vertices in * <code>g</code>, ignoring edge weights. * * @see #diameter(Hypergraph) * @see edu.uci.ics.jung.algorithms.scoring.ClosenessCentrality */ public static <V, E> Transformer<V, Double> averageDistances( Hypergraph<V, E> g) { final ClosenessCentrality<V, E> cc = new ClosenessCentrality<V, E>(g, new UnweightedShortestPath<V, E>(g)); return new VertexScoreTransformer<V, Double>(cc); }
/** * 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)); } }
/** * For each vertex <code>v</code> in <code>g</code>, * calculates the average shortest path length from <code>v</code> * to all other vertices in <code>g</code>, ignoring edge weights. * @see #diameter(Hypergraph) * @see edu.uci.ics.jung.algorithms.scoring.ClosenessCentrality */ public static <V,E> Transformer<V, Double> averageDistances(Hypergraph<V,E> g) { final ClosenessCentrality<V,E> cc = new ClosenessCentrality<V,E>(g, new UnweightedShortestPath<V,E>(g)); return new VertexScoreTransformer<V, Double>(cc); }
/** * For each vertex <code>v</code> in <code>g</code>, * calculates the average shortest path length from <code>v</code> * to all other vertices in <code>g</code>, ignoring edge weights. * @see #diameter(Hypergraph) * @see edu.uci.ics.jung.algorithms.scoring.ClosenessCentrality * * @param g the graph for which distances are to be calculated * @param <V> the vertex type * @param <E> the edge type * @return a map from each vertex to the mean distance to each other (reachable) vertex */ public static <V,E> Function<V, Double> averageDistances(Hypergraph<V,E> g) { final ClosenessCentrality<V,E> cc = new ClosenessCentrality<V,E>(g, new UnweightedShortestPath<V,E>(g)); return new VertexScoreTransformer<V, Double>(cc); }
/** * For each node <code>v</code> in <code>g</code>, calculates the average shortest path length * from <code>v</code> to all other nodes in <code>g</code>, ignoring edge weights. * * @see #diameter(Hypergraph) * @see edu.uci.ics.jung.algorithms.scoring.ClosenessCentrality * @param g the graph for which distances are to be calculated * @param <N> the node type * @param <E> the edge type * @return a map from each node to the mean distance to each other (reachable) node */ public static <N, E> Function<N, Double> averageDistances(Network<N, E> g) { final ClosenessCentrality<N, E> cc = new ClosenessCentrality<N, E>(g, new UnweightedShortestPath<N>(g.asGraph())); return new NodeScoreTransformer<N, Double>(cc); }
@Override public void visit(LayoutModel<N> layoutModel) { super.visit(layoutModel); Graph<N> graph = layoutModel.getGraph(); if (graph != null) { Distance distance = new UnweightedShortestPath<N>(graph); this.distance = (x, y) -> distance.getDistance(x, y); } initialize(); }