PageRank

PageRank is an algorithm used by Google Search to rank their websites in the search results. PageRank is a network-based algorithm and it is a way of measuring the importance of nodes in a network. PageRank is not the only algorithm used by Google to order search results but it is the first algorithm that was used by the company. An intuitive way of understanding the PageRank algorithm is through the random surfer model. The random surfer model simulates a user who starts from some random node and follows random links from the page he is currently in.

Now let us try to simulate the random surfer model for a random graph. Please enter your input for the number of nodes and the probability of having a edge between two random nodes:


Number of nodes:
Probability of edges:




In the above simulation of random surfer model, we notice that the surfer may get stuck at a node that does not link to any other page. To prevent this from happening, we assign a small random probability with which the user goes to a random page, that is not necessarily linked from the current page. This is the PageRank algorithm. Therefore PageRank algorithm can be understood as a random surfer model with a small probability of landing at a random node.

Now let us try to simulate the random surfer model for a random graph. Please enter your input for the number of nodes and the probability of having a edge between two random nodes:


Number of nodes:
Probability of edges: