/** * 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); }
/** * Equivalent to <code>this(graph, edge_weights, averaging, true, true)</code>. * @param graph The graph on which the vertex scores are to be * calculated. * @param edge_weights The edge weights to use for specifying the distance * between pairs of vertices. * @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, Function<E, ? extends Number> edge_weights, boolean averaging) { this(graph, new DijkstraDistance<V,E>(graph, edge_weights), averaging, true, true); }
/** * Equivalent to <code>this(graph, edge_weights, averaging, true, true)</code>. * @param graph The graph on which the vertex scores are to be * calculated. * @param edge_weights The edge weights to use for specifying the distance * between pairs of vertices. * @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, Transformer<E, ? extends Number> edge_weights, boolean averaging) { this(graph, new DijkstraDistance<V,E>(graph, edge_weights), averaging, true, true); }
/** * Equivalent to * <code>this(graph, edge_weights, averaging, true, true)</code>. * * @param graph * The graph on which the vertex scores are to be calculated. * @param edge_weights * The edge weights to use for specifying the distance between * pairs of vertices. * @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, Transformer<E, ? extends Number> edge_weights, boolean averaging) { this(graph, new DijkstraDistance<V, E>(graph, edge_weights), averaging, true, true); }
/** * Creates an instance with the specified graph and averaging behavior whose * vertex distances are calculated based on the specified edge weights. * * @param graph * The graph on which the vertex scores are to be calculated. * @param edge_weights * The edge weights to use for specifying the distance between * pairs of vertices. * @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, Transformer<E, ? extends Number> edge_weights, boolean averaging, boolean ignore_missing, boolean ignore_self_distances) { this(graph, new DijkstraDistance<V, E>(graph, edge_weights), averaging, ignore_missing, ignore_self_distances); }
/** * Creates an instance with the specified graph and averaging behavior * whose vertex distances are calculated based on the specified edge * weights. * * @param graph The graph on which the vertex scores are to be * calculated. * @param edge_weights The edge weights to use for specifying the distance * between pairs of vertices. * @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, Function<E, ? extends Number> edge_weights, boolean averaging, boolean ignore_missing, boolean ignore_self_distances) { this(graph, new DijkstraDistance<V,E>(graph, edge_weights), averaging, ignore_missing, ignore_self_distances); }
/** * Creates an instance with the specified graph and averaging behavior * whose vertex distances are calculated based on the specified edge * weights. * * @param graph The graph on which the vertex scores are to be * calculated. * @param edge_weights The edge weights to use for specifying the distance * between pairs of vertices. * @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, Transformer<E, ? extends Number> edge_weights, boolean averaging, boolean ignore_missing, boolean ignore_self_distances) { this(graph, new DijkstraDistance<V,E>(graph, edge_weights), averaging, ignore_missing, ignore_self_distances); }
/** * Creates an instance with the specified graph and averaging behavior whose node distances are * calculated based on the specified edge weights. * * @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. * @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 node to itself should be * included in its score. */ public DistanceCentralityScorer( Network<N, E> graph, Function<E, ? extends Number> edge_weights, boolean averaging, boolean ignore_missing, boolean ignore_self_distances) { this( graph, new DijkstraDistance<N, E>(graph, edge_weights), averaging, ignore_missing, ignore_self_distances); }
private Layout<Node, Edge> newLayout(final Diagram diagram) { final Layout<Node, Edge> diagramLayout; if (layout != null && layout.startsWith("spring")) { diagramLayout = new SpringLayout<Node, Edge>(diagram, new ConstantTransformer(Integer.parseInt(config("spring", "100")))); } else if (layout != null && layout.startsWith("kk")) { Distance<Node> distance = new DijkstraDistance<Node, Edge>(diagram); if (layout.endsWith("unweight")) { distance = new UnweightedShortestPath<Node, Edge>(diagram); } diagramLayout = new KKLayout<Node, Edge>(diagram, distance); } else if (layout != null && layout.equalsIgnoreCase("circle")) { diagramLayout = new CircleLayout<Node, Edge>(diagram); } else if (layout != null && layout.equalsIgnoreCase("fr")) { diagramLayout = new FRLayout<Node, Edge>(diagram); } else { final LevelLayout levelLayout = new LevelLayout(diagram); levelLayout.adjust = adjust; diagramLayout = levelLayout; } return diagramLayout; }
/** * Check for selection of an AttributeName. */ public void actionPerformed(ActionEvent arg0) { ONDEXJUNGGraph aog = (ONDEXJUNGGraph) graph; JComboBox box = (JComboBox) arg0.getSource(); String name = (String) box.getSelectedItem(); an = aog.getMetaData().getAttributeName(name); if (an == null) { this.distance = new UnweightedShortestPath<ONDEXConcept, ONDEXRelation>( graph); this.reset(); } else { this.distance = new DijkstraDistance<ONDEXConcept, ONDEXRelation>( graph, new GDSEdges(an, inverseScale), true); this.reset(); } }
final List<Link> linksToConsider = links.stream().filter(e->linkWeightMap.get(e) != Double.MAX_VALUE).collect(Collectors.toList()); final Graph<Node, Link> graph = JUNGUtils.getGraphFromLinkMap(nodes, linksToConsider); final DijkstraDistance<Node,Link> shortestDistanceMatrix = new DijkstraDistance<Node,Link> (graph, nev); final List<Demand> frDemands = new ArrayList<> (); final List<Link> frLinks = new ArrayList<> ();
final List<Link> linksToConsider = links.stream().filter(e->linkWeightMap.get(e) != Double.MAX_VALUE).collect(Collectors.toList()); final Graph<Node, Link> graph = JUNGUtils.getGraphFromLinkMap(nodes, linksToConsider); final DijkstraDistance<Node,Link> shortestDistanceMatrix = new DijkstraDistance<Node,Link> (graph, nev);