edu.iu.iv.search.p2p.randomWalk
Class RandomWalk

java.lang.Object
  |
  +--edu.iu.iv.search.p2p.randomWalk.RandomWalk

public class RandomWalk
extends java.lang.Object

Random-Walk Search Algorithm

Author:
Hardik Sheth (hsheth@indiana.edu)

Constructor Summary
RandomWalk(edu.uci.ics.jung.graph.Graph graph)
          Constructor for RandomWalk Search Algorithm.
RandomWalk(edu.uci.ics.jung.graph.Graph graph, int numWalkers)
          Constructor for RandomWalk Search Algorithm.
 
Method Summary
 java.lang.String getFailReason()
          Get the reason because of which modelig failed
 int getNumWalkers()
          Get the number of walkers used for search
 int getSearchCost()
          Return the cost (number of the messages) of the search performed
 boolean searchNetwork(int fromId, int toId)
          Search random network
 boolean searchNetwork(int fromId, int toId, int numWalkers)
          Search random network
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomWalk

public RandomWalk(edu.uci.ics.jung.graph.Graph graph)
Constructor for RandomWalk Search Algorithm. It requires that a graph object be passed that represents the network on which the search is to be performed.

Parameters:
graph -

RandomWalk

public RandomWalk(edu.uci.ics.jung.graph.Graph graph,
                  int numWalkers)
Constructor for RandomWalk Search Algorithm. It requires that a graph object be passed that represents the network on which the search is to be performed and the number of walkers to perform the random walk

Parameters:
graph -
numWalkers -
Method Detail

searchNetwork

public boolean searchNetwork(int fromId,
                             int toId,
                             int numWalkers)
Search random network

Parameters:
fromId - - source node from where search begins
toId - - target node to be found
numWalkers - - number of walkers to perform the search
Returns:
true if node found, false otherwise

searchNetwork

public boolean searchNetwork(int fromId,
                             int toId)
Search random network

Parameters:
fromId - - source node from where search begins
toId - - target node to be found
Returns:
true if node found, false otherwise

getSearchCost

public int getSearchCost()
Return the cost (number of the messages) of the search performed

Returns:
searchCost

getNumWalkers

public int getNumWalkers()
Get the number of walkers used for search

Returns:
numWalkers

getFailReason

public java.lang.String getFailReason()
Get the reason because of which modelig failed

Returns:
reason