PageRank Example?

Topics: algorithm
May 2, 2009 at 10:52 PM
Hi, I just started using QuickGraph, and I am trying to rank a bi-graph using the PageRank algorithm but have had no success. Could anyone include a simple example of how to use this algorithm?

Here's what I've tried:

 

influencegraph =

new BidirectionalGraph<string,Edge<string>>();

 

influencegraph.AddVertex(

"Joe");

 

influencegraph.AddVertex(

"Bob");

 

influencegraph.AddEdge(

new Edge<string>("Joe", "Bob"));

 



PageRankAlgorithm<String, Edge<String>> pra = new PageRankAlgorithm<string, Edge<string>>(influencegraph);

String ranks = "";

pra.InitializeRanks();

pra.Compute();

 

 

for (int i = 0; i < pra.Ranks.Count(); i++)

ranks += pra.Ranks.ElementAt(i).ToString() + System.

Environment.NewLine;

 


When I try this, I get a stack overflow exception on the compute call. I'm sure I'm doing it completely wrong, but I couldn't find any documentation on the algorithm. Any help would be greatly appreciated!

Thanks!

May 3, 2009 at 2:43 AM
Nevermind. I built from the latest source, and it's now working.

Thanks!
Coordinator
May 3, 2009 at 11:40 PM
Look like I should do a release then...