edu.iu.iv.search.p2p.can
Class CanSearch

java.lang.Object
  |
  +--edu.iu.iv.search.p2p.can.CanSearch

public class CanSearch
extends java.lang.Object

Implements the CAN Search Algorithm. Requires the network in the form of a graph object on which the search is to be performed

Author:
Hardik Sheth (hsheth@indiana.edu)

Constructor Summary
CanSearch(edu.uci.ics.jung.graph.Graph graph)
          Constructor for CanSearch algorithm.
 
Method Summary
 java.lang.String getFailReason()
          Get the reason because of which modelig failed
 edu.uci.ics.jung.graph.impl.UndirectedSparseGraph getGraph()
          Get the graph on which search was performed
 int getNetworkSize()
          Get size of the network
 int getSearchCost()
          This methods returns the number of messages (i.e.
 boolean searchNetwork(int fromId, int toId)
          This method performs search on the graph, given the source and target nodes.
 void setGraph(edu.uci.ics.jung.graph.impl.UndirectedSparseGraph graph)
          Set the graph to search
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CanSearch

public CanSearch(edu.uci.ics.jung.graph.Graph graph)
Constructor for CanSearch algorithm. It requires that a graph object be passed that represents the network on which the search is to be performed. Graph should have a userdatum attached to it that stores various information related to the network.

Parameters:
graph -
Method Detail

searchNetwork

public boolean searchNetwork(int fromId,
                             int toId)
This method performs search on the graph, given the source and target nodes. It calls the search method with appropriate parameters for actual search.

Parameters:
fromId -
toId -
Returns:
boolean

getSearchCost

public int getSearchCost()
This methods returns the number of messages (i.e. Search Cost) passed in the network to perform search.

Returns:
search cost

getGraph

public edu.uci.ics.jung.graph.impl.UndirectedSparseGraph getGraph()
Get the graph on which search was performed

Returns:
graph

getNetworkSize

public int getNetworkSize()
Get size of the network

Returns:
network size

setGraph

public void setGraph(edu.uci.ics.jung.graph.impl.UndirectedSparseGraph graph)
Set the graph to search

Parameters:
graph -

getFailReason

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

Returns:
reason