private void calculateVertexPageRank(IVertexCollection vertices, Dictionary<Int32, Double> oldPageRanks, out Dictionary<Int32, Double> newPageRanks)
{
newPageRanks = new Dictionary<Int32, Double>(vertices.Count);
foreach(IVertex node in vertices){
ICollection<IVertex> adjacentNodes = node.AdjacentVertices;
double newRank = (1 - damping_factor) / vertices.Count;
foreach (IVertex adjNode in adjacentNodes) {
double adjNodeRank;
oldPageRanks.TryGetValue(adjNode.ID, out adjNodeRank);
newRank += damping_factor * adjNodeRank / adjNode.AdjacentVertices.Count;
}
newPageRanks.Add(node.ID, newRank);
}
}