public class WeightedNIPaths<V,E> extends AbstractRanker<V,E>
This algorithm uses heuristic breadth-first search to try and find the maximum-sized set of node-disjoint paths between two nodes. As such, it is not guaranteed to give exact answers.
A simple example of usage is:
WeightedNIPaths ranker = new WeightedNIPaths(someGraph,2.0,6,rootSet); ranker.evaluate(); ranker.printRankings();
Modifier and Type | Field and Description |
---|---|
static String |
WEIGHTED_NIPATHS_KEY |
edgeRankScores, vertexRankScores
Constructor and Description |
---|
WeightedNIPaths(DirectedGraph<V,E> graph,
com.google.common.base.Supplier<V> vertexFactory,
com.google.common.base.Supplier<E> edgeFactory,
double alpha,
int maxDepth,
Set<V> priors)
Constructs and initializes the algorithm.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeWeightedPathsFromSource(V root,
int depth) |
String |
getRankScoreKey()
Given a node, returns the corresponding rank score.
|
protected void |
incrementRankScore(V v,
double rankValue) |
protected void |
onFinalize(Object udc) |
void |
step()
Evaluate the result of the current iteration.
|
assignDefaultEdgeTransitionWeights, finalizeIterations, getEdgeRankScore, getEdgeRankScore, getEdgeRankScores, getEdgeRankScores, getEdgeWeight, getEdgeWeights, getGraph, getRankings, getRankScores, getVertexCount, getVertexRankScore, getVertexRankScore, getVertexRankScores, getVertexRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, printRankings, removeEdgeRankScore, removeEdgeRankScore, removeVertexRankScore, removeVertexRankScore, reset, setEdgeRankScore, setEdgeRankScore, setEdgeWeight, setEdgeWeights, setNormalizeRankings, setRemoveRankScoresOnFinalize, setVertexRankScore, setVertexRankScore
done, evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, initializeIterations, relativePrecision, setDesiredPrecision, setMaximumIterations, setPrecision
public static final String WEIGHTED_NIPATHS_KEY
public WeightedNIPaths(DirectedGraph<V,E> graph, com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory, double alpha, int maxDepth, Set<V> priors)
graph
- the graph whose nodes are being measured for their importancevertexFactory
- used to generate instances of VedgeFactory
- used to generate instances of Ealpha
- the path decay coefficient (≥1); 2 is recommendedmaxDepth
- the maximal depth to search out from the root setpriors
- the root set (starting vertices)protected void incrementRankScore(V v, double rankValue)
protected void computeWeightedPathsFromSource(V root, int depth)
public void step()
IterativeProcess
step
in interface IterativeContext
step
in class IterativeProcess
public String getRankScoreKey()
getRankScore
assumes
the decoration representing the rank score is of type MutableDouble
.getRankScoreKey
in class AbstractRanker<V,E>
protected void onFinalize(Object udc)
onFinalize
in class AbstractRanker<V,E>
Copyright © 2015. All rights reserved.