/** * Returns the score for this vertex. */ @Override public S transform(V v) { return vs.getVertexScore(v); }
/** * Creates an instance with the specified graph and default edge weights. * (Default edge weights: <code>UniformDegreeWeight</code>.) * @param graph the graph for which the centrality is to be calculated. */ public EigenvectorCentrality(Hypergraph<V,E> graph) { super(graph, 0); acceptDisconnectedGraph(false); } }
/** * Initializes the state of this instance. */ @Override public void initialize() { super.initialize(); // initialize output values to priors // (output and current are swapped before each step(), so current will // have priors when update()s start happening) for (V v : graph.getVertices()) { setOutputValue(v, getVertexPrior(v)); } }
/** Initializes the state of this instance. */ @Override public void initialize() { super.initialize(); // initialize output values to priors // (output and current are swapped before each step(), so current will // have priors when update()s start happening) for (N v : graph.nodes()) { setOutputValue(v, getNodePrior(v)); } }
/** * Creates an instance for the specified graph, node priors, and random jump probability (alpha). * The edge weights default to 1.0. * * @param g the input graph * @param node_priors the prior probability for each node * @param alpha the probability of a random jump at each step */ public HITSWithPriors(Network<N, E> g, Function<N, HITS.Scores> node_priors, double alpha) { super(g, n -> 1.0, node_priors, alpha); disappearing_potential = new HITS.Scores(0, 0); }
/** * Creates an instance based on the specified graph, node priors (initial scores), and number of * steps to take. The edge weights (transition probabilities) are set to default values (a uniform * distribution over all outgoing edges). * * @param graph the input graph * @param node_priors the initial probability distribution (score assignment) * @param steps the number of times that {@code step()} will be called by {@code evaluate} */ public KStepMarkov(Network<N, E> graph, Function<N, Double> node_priors, int steps) { super(graph, node_priors, 0); initialize(steps); }
/** * Creates an instance for the specified graph and edge weights. * @param g the graph for which the instance is to be created * @param edge_weights the edge weights for this instance */ public AbstractIterativeScorer(Hypergraph<V,E> g, Transformer<E, ? extends Number> edge_weights) { this.graph = g; this.max_iterations = 100; this.tolerance = 0.001; this.accept_disconnected_graph = true; setEdgeWeights(edge_weights); }
/** * @param v the node whose score is being returned * @return the score for this node. */ public S apply(N v) { return vs.getNodeScore(v); } }
/** * Initializes the state of this instance. */ @Override public void initialize() { super.initialize(); // initialize output values to priors // (output and current are swapped before each step(), so current will // have priors when update()s start happening) for (V v : graph.getVertices()) setOutputValue(v, getVertexPrior(v)); }
/** * Creates an instance with the specified graph and default edge weights. (Default edge weights: * <code>UniformDegreeWeight</code>.) * * @param graph the graph for which the centrality is to be calculated. */ public EigenvectorCentrality(Network<N, E> graph) { super(graph, 0); acceptDisconnectedGraph(false); } }
/** * Returns the score for this vertex. */ public S transform(V v) { return vs.getVertexScore(v); }
/** * Initializes the state of this instance. */ @Override public void initialize() { super.initialize(); // initialize output values to priors // (output and current are swapped before each step(), so current will // have priors when update()s start happening) for (V v : graph.getVertices()) setOutputValue(v, getVertexPrior(v)); }
/** * Creates an instance with the specified graph and default edge weights. * (Default edge weights: <code>UniformDegreeWeight</code>.) * * @param graph * the graph for which the centrality is to be calculated. */ public EigenvectorCentrality(Hypergraph<V, E> graph) { super(graph, 0); acceptDisconnectedGraph(false); } }
/** * @param v the vertex whose score is being returned * @return the score for this vertex. */ public S apply(V v) { return vs.getVertexScore(v); }
/** * Creates an instance with the specified graph and edge weights. The outgoing edge weights for * each edge must sum to 1. (See <code>UniformDegreeWeight</code> for one way to handle this for * undirected graphs.) * * @param graph the graph for which the centrality is to be calculated * @param edge_weights the edge weights */ public EigenvectorCentrality(Network<N, E> graph, Function<E, ? extends Number> edge_weights) { super(graph, edge_weights, 0); acceptDisconnectedGraph(false); }
/** * Creates an instance with the specified graph and default edge weights. * (Default edge weights: <code>UniformDegreeWeight</code>.) * @param graph the graph for which the centrality is to be calculated. */ public EigenvectorCentrality(Hypergraph<V,E> graph) { super(graph, 0); acceptDisconnectedGraph(false); } }