public class WeightedNIPaths extends AbstractRanker
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 java.lang.String |
WEIGHTED_NIPATHS_KEY |
DEFAULT_EDGE_WEIGHT_KEY
Constructor and Description |
---|
WeightedNIPaths(DirectedGraph graph,
double alpha,
int maxDepth,
java.util.Set priors)
Constructs and initializes the algorithm.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeWeightedPathsFromSource(Vertex root,
int depth) |
protected double |
evaluateIteration()
Evaluate the result of the current interation.
|
java.lang.String |
getRankScoreKey()
Given a node, returns the corresponding rank score.
|
protected void |
incrementRankScore(Element v,
double rankValue) |
protected void |
onFinalize(Element udc) |
assignDefaultEdgeTransitionWeights, finalizeIterations, getEdgeWeight, getEdgeWeightKeyName, getGraph, getRankings, getRankScore, getRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, printRankings, reinitialize, setEdgeWeight, setNormalizeRankings, setRankScore, setRemoveRankScoresOnFinalize, setUserDefinedEdgeWeightKey
evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, initializeIterations, relativePrecision, setDesiredPrecision, setMaximumIterations
public static final java.lang.String WEIGHTED_NIPATHS_KEY
public WeightedNIPaths(DirectedGraph graph, double alpha, int maxDepth, java.util.Set priors)
graph
- the graph whose nodes are being measured for their importancealpha
- the path decay coefficient (>= 1); 2 is recommendedmaxDepth
- the maximal depth to search out from the root setpriors
- the root set (starting vertices)public java.lang.String getRankScoreKey()
getRankScore
assumes
the decoration representing the rank score is of type MutableDouble
.getRankScoreKey
in class AbstractRanker
protected void incrementRankScore(Element v, double rankValue)
protected void computeWeightedPathsFromSource(Vertex root, int depth)
protected double evaluateIteration()
IterativeProcess
evaluateIteration
in class IterativeProcess
protected void onFinalize(Element udc)
onFinalize
in class AbstractRanker