|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.tumba.links.PageRank
public class PageRank
Pagerank is a an algorithm that Google utilizes to rank its search results in presence of multiple resources matching a certain query. In very simple words Pagerank evaluates and ranks Web sites according to a computed value determined by the number of other sites linking to them. The way the Pagerank value is computed makes Pagerank somewhat immune to artificial linking efforts. The rank (a numerical measure of importance) of each web page is dependent on the importance conferred on it by other web pages that have links to it; each web page divides its importance equally amongst all of the web pages it references. The rank R(p) for any web page p can be expressed via a simple summation given the set of web pages B(p) that link to p and the outdegree function d+: V -> Z: R(p) = sum(q in B(p), R(q)/d+(q)) Note that the right-hand side of the expression may contain R(p), because the rank of some R(q) may depend on R(p). For this reason, the rank of each web page is not computed directly, but instead an iterative algorithm is applied using the formula: Ri+1(p) = sum(q in B(p), Ri(q)/d+(q))
Field Summary | |
---|---|
private double |
dampening
The value for the PageRank dampening factor |
private WebGraph |
graph
The data structure containing the Web linkage graph |
private java.util.Map |
scores
A Map containing the PageRank values for each page |
Constructor Summary | |
---|---|
PageRank(WebGraph graph)
Constructor for PageRank |
Method Summary | |
---|---|
void |
computePagerank()
Computes the PageRank value for all the nodes in the Web Graph. |
void |
computePagerank(int iter)
Computes the PageRank value for all the nodes in the Web Graph. |
double |
getDampening()
Returns the dampening factor used for the PageRank Algorithm. |
void |
initializePageRank(java.lang.Integer id,
double value)
Initializes PageRank value associated with a given link identifyer. |
void |
initializePageRank(java.lang.String link,
double value)
Initializes the PageRank value associated with a given link. |
private java.lang.Double |
pageRank(java.lang.Integer id)
Returns the PageRank value associated with a given link identifyer. |
java.lang.Double |
pageRank(java.lang.String link)
Returns the PageRank value associated with a given link |
void |
setDampening(double damp)
Sets the value for the PageRank dampening factor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private double dampening
private WebGraph graph
private java.util.Map scores
Map
containing the PageRank values for each page
Constructor Detail |
---|
public PageRank(WebGraph graph)
graph
- The data structure containing the Web linkage graphMethod Detail |
---|
public void setDampening(double damp)
damp
- The dampening factorpublic double getDampening()
public java.lang.Double pageRank(java.lang.String link)
link
- The url for the link
private java.lang.Double pageRank(java.lang.Integer id)
WebGraph
to
represent the Web graph for efficiency reasons.
link
- An identifyer for the link
WebGraph.IdentifyerToURL()
public void initializePageRank(java.lang.String link, double value)
link
- The url for the linkvalue
- The PageRank value to assignpublic void initializePageRank(java.lang.Integer id, double value)
WebGraph
to
represent the Web graph for efficiency reasons.
link
- An identifyer for the linkvalue
- The PageRank value to assignWebGraph.IdentifyerToURL()
public void computePagerank()
public void computePagerank(int iter)
iter
- The number of iterations for the algorithm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |