|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.matalon.pagerankhits.util.AlgorithmComparator
This class is responsible for comparing the results of all 3 relevant algorithms: Google's PageRank, Kleinberg's HITS and our modification to Kleinberg's HITS.
| Constructor Summary | |
AlgorithmComparator()
|
|
| Method Summary | |
static int[] |
comparePositions(java.lang.Integer[] pagePositions1,
java.lang.Integer[] pagePositions2,
int totalNoOfPages)
Compares the given page positions (as returned by org.matalon.pagerankhits.util.AlgorithmComparator#compareResults(resultsNo, compare2Algorithm)). |
static java.lang.Object[] |
compareResults(int resultsNo,
java.lang.String compare2Algorithm)
This method returns the top resultsNo URLs, as computed by the
given algorithm. |
static java.lang.Integer[] |
getDefaultUrlPositions(int length)
|
static java.lang.String[] |
getSubArray(java.lang.String[] array,
int beginIndex,
int endIndex)
|
static java.lang.Integer[] |
getUrlPositions(java.lang.String[] urlsSubset,
java.lang.String[] urlsSet)
Finds all urlsSubset's URLs inside urlsSet and returns
their positions. |
static java.lang.String[] |
getUrlResults(java.lang.String algorithm)
Returns all the URLs, ordered by their importance according to the given algorithm. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AlgorithmComparator()
| Method Detail |
public static final java.lang.Object[] compareResults(int resultsNo,
java.lang.String compare2Algorithm)
resultsNo URLs, as computed by the
given algorithm. In addition, it returns the position of each page, as computed
by all 3 algorithms: Google's PageRank, Kleinberg's HITS and our modification to
Kleinberg's HITS.
The position is set according to the rank of the page; the page with the highest
rank gets the position 1, the page with the second highest rank gets the position
2 and so on.
Assumption: The results of PageRank algorithm are saved in
GeneralSettings.FILE_PAGERANK_RESULT_OBJECT, the results of HITS
algorithm are saved in GeneralSettings.FILE_HITS_RESULT_OBJECT and
the results of our modified HITS algorithm are saved in
GeneralSettings.FILE_HITS_MODIFIED_RESULT_OBJECT.
resultsNo - compare2Algorithm -
resultsNo URLs (according to the given
algorithm), and 3 for the positions of these URLs according to PageRank, HITS and
our modified HITS, respectively.
Technically, this method returns Object[5] = {
Integer[1]: The total number of pages,
String[resultsNo]: The URLs of the top resultsNo pages,
Integer[resultsNo]: The positions of the top resultsNo pages
according to PageRank algorithm,
Integer[resultsNo]: The positions of the top resultsNo pages
according to HITS algorithm,
Integer[resultsNo]: The positions of the top resultsNo pages
according to our modified HITS algorithm
}public static final java.lang.String[] getUrlResults(java.lang.String algorithm)
algorithm.
The URLs are taken from the results file of the given algorithm.
Assumption: The results of PageRank algorithm are saved in
GeneralSettings.FILE_PAGERANK_RESULT_OBJECT, the results of HITS
algorithm are saved in GeneralSettings.FILE_HITS_RESULT_OBJECT and
the results of our modified HITS algorithm are saved in
GeneralSettings.FILE_HITS_MODIFIED_RESULT_OBJECT.
algorithm -
algorithm.public static final java.lang.Integer[] getDefaultUrlPositions(int length)
length -
length where array[i] = new Integer(i+1).
public static final java.lang.Integer[] getUrlPositions(java.lang.String[] urlsSubset,
java.lang.String[] urlsSet)
urlsSubset's URLs inside urlsSet and returns
their positions.
Assumption: urlsSubset is a subset of urlsSet.
urlsSubset - urlsSet -
urlsSubset's URLs inside urlsSet.
public static final int[] comparePositions(java.lang.Integer[] pagePositions1,
java.lang.Integer[] pagePositions2,
int totalNoOfPages)
pagePositions1 and pagePositions2 have the same length.
pagePositions1 - pagePositions2 - totalNoOfPages -
public static final java.lang.String[] getSubArray(java.lang.String[] array,
int beginIndex,
int endIndex)
array - beginIndex - endIndex -
beginIndex and
ending at endIndex (inclusive).
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||