fix NaN and undirected traversal bug for PageRank