/*
* Copyright (c) 2003, the JUNG Project and the Regents of the University
* of California
* All rights reserved.
*
* This software is open-source under the BSD license; see either
* "license.txt" or
* http://jung.sourceforge.net/license.txt for a description.
*/
package edu.uci.ics.jung.algorithms.importance;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.collections15.Factory;
import edu.uci.ics.jung.graph.DirectedGraph;
/**
* This algorithm measures the importance of nodes based upon both the number and length of disjoint paths that lead
* to a given node from each of the nodes in the root set. Specifically the formula for measuring the importance of a
* node is given by: I(t|R) = sum_i=1_|P(r,t)|_{alpha^|p_i|} where alpha is the path decay coefficient, p_i is path i
* and P(r,t) is a set of maximum-sized node-disjoint paths from r to t.
*
* 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.
*
*
* @author Scott White
* @see "Algorithms for Estimating Relative Importance in Graphs by Scott White and Padhraic Smyth, 2003"
*/
public class WeightedNIPaths extends AbstractRanker {
public final static String WEIGHTED_NIPATHS_KEY = "jung.algorithms.importance.WEIGHTED_NIPATHS_KEY";
private double mAlpha;
private int mMaxDepth;
private Set mPriors;
private Map pathIndices = new HashMap();
private Map