|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.matalon.pagerankhits.dataStructures.WebGraph
This class is an implementation of a graph for representing a web structure; each vertex represents an URL while each edge represents a link between them.
Field Summary | |
private java.util.List[] |
adjacencyListArray
|
private static int |
lastGeneratedVertexId
|
private java.util.Map |
verticesIds
|
private java.util.Map |
verticesNames
|
Fields inherited from interface org.matalon.pagerankhits.dataStructures.Graph |
PAGERANK_ALPHA_FACTOR_DENOMINATOR, PAGERANK_ALPHA_FACTOR_NUMERATOR |
Constructor Summary | |
WebGraph(int maxVerticesNo)
Constructor. |
Method Summary | |
boolean |
addEdge(Vertex v1,
Vertex v2)
Adds the given vertices (if they don't already exist) and an edge between them (if it doesn't already exist). |
boolean |
addVertex(Vertex v)
Adds the given vertex if it doesn't already exist. |
private static long[] |
correctPageRankMatrix1(int totalNumOfPages)
Google's first correction to PageRank(TM) algorithm. |
private static java.lang.String |
correctPageRankMatrix2(long correctedCellNumerator,
long correctedCellDenominator,
long totalNumOfPages)
Google's second correction to PageRank(TM) algorithm. |
private static long |
gcd(long num1,
long num2)
|
java.lang.String[][] |
getAdjacencyMatrix()
|
java.lang.String[][] |
getAdjacencyMatrix(int rowStart,
int rowEnd,
int colStart,
int colEnd)
|
java.lang.String[][] |
getInnerLinkRankMatrix()
|
java.lang.String[][] |
getInnerLinkRankMatrix(int rowStart,
int rowEnd,
int colStart,
int colEnd)
|
java.lang.String[][] |
getPageRankMatrix()
|
java.lang.String[][] |
getPageRankMatrix(int rowStart,
int rowEnd,
int colStart,
int colEnd)
|
java.lang.String[][] |
getPageRankMatrixCorrected()
|
java.lang.String[][] |
getPageRankMatrixCorrected(int rowStart,
int rowEnd,
int colStart,
int colEnd)
|
private int |
getVertexId(Vertex v)
|
java.util.Map |
getVertexId2NameMap()
|
java.util.Map |
getVertexName2IdMap()
|
java.lang.String |
getVertexNameById(int vertexId)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Map verticesNames
private java.util.Map verticesIds
private java.util.List[] adjacencyListArray
private static int lastGeneratedVertexId
Constructor Detail |
public WebGraph(int maxVerticesNo) throws InvalidParameterException
maxVerticesNo
-
InvalidParameterException
Method Detail |
public boolean addEdge(Vertex v1, Vertex v2)
addEdge
in interface Graph
v1
- v2
-
Graph.addEdge(org.matalon.pagerankhits.dataStructures.Vertex, org.matalon.pagerankhits.dataStructures.Vertex)
public boolean addVertex(Vertex v)
addVertex
in interface Graph
v
-
Graph.addVertex(org.matalon.pagerankhits.dataStructures.Vertex)
public java.lang.String[][] getAdjacencyMatrix()
getAdjacencyMatrix
in interface Graph
Graph.getAdjacencyMatrix()
public java.lang.String[][] getAdjacencyMatrix(int rowStart, int rowEnd, int colStart, int colEnd) throws InvalidParameterException
getAdjacencyMatrix
in interface Graph
rowStart
- rowEnd
- colStart
- colEnd
-
InvalidParameterException
Graph.getAdjacencyMatrix(int, int, int, int)
public java.lang.String[][] getInnerLinkRankMatrix()
getInnerLinkRankMatrix
in interface Graph
Graph.getInnerLinkRankMatrix()
public java.lang.String[][] getInnerLinkRankMatrix(int rowStart, int rowEnd, int colStart, int colEnd) throws InvalidParameterException
getInnerLinkRankMatrix
in interface Graph
rowStart
- rowEnd
- colStart
- colEnd
-
InvalidParameterException
Graph.getInnerLinkRankMatrix(int, int, int, int)
public java.lang.String[][] getPageRankMatrix()
getPageRankMatrix
in interface Graph
Graph.getPageRankMatrix()
public java.lang.String[][] getPageRankMatrix(int rowStart, int rowEnd, int colStart, int colEnd) throws InvalidParameterException
getPageRankMatrix
in interface Graph
rowStart
- rowEnd
- colStart
- colEnd
-
InvalidParameterException
Graph.getPageRankMatrix(int, int, int, int)
public java.lang.String[][] getPageRankMatrixCorrected()
getPageRankMatrixCorrected
in interface Graph
Graph.getPageRankMatrixCorrected()
public java.lang.String[][] getPageRankMatrixCorrected(int rowStart, int rowEnd, int colStart, int colEnd) throws InvalidParameterException
getPageRankMatrixCorrected
in interface Graph
rowStart
- rowEnd
- colStart
- colEnd
-
InvalidParameterException
Graph.getPageRankMatrixCorrected(int, int, int, int)
private final int getVertexId(Vertex v) throws VertexDoesNotExistException
v
-
VertexDoesNotExistException
public final java.lang.String getVertexNameById(int vertexId) throws VertexDoesNotExistException
getVertexNameById
in interface Graph
vertexId
-
VertexDoesNotExistException
private static final long[] correctPageRankMatrix1(int totalNumOfPages)
totalNumOfPages
-
private static final java.lang.String correctPageRankMatrix2(long correctedCellNumerator, long correctedCellDenominator, long totalNumOfPages)
correctedCellNumerator
- - numerator of the value of the cell, which was
corrected by Google's first correction.correctedCellDenominator
- - denominator of the value of the cell, which
was corrected by Google's first correction.totalNumOfPages
-
private static final long gcd(long num1, long num2)
num1
- num2
-
public java.util.Map getVertexId2NameMap()
getVertexId2NameMap
in interface Graph
Graph.getVertexId2NameMap()
public java.util.Map getVertexName2IdMap()
getVertexName2IdMap
in interface Graph
Graph.getVertexName2IdMap()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |