Skip to content

Instantly share code, notes, and snippets.

@gulshanbaraik01
gulshanbaraik01 / random_walk_method.py
Created June 21, 2020 11:14
Random Walk Method - Page Rank Algorithm using networkx
# Importing the necessary libraries to execute the "Random Walk Method"
import networkx as nx
import random
import matplotlib.pyplot as plt
import operator
#select random graph using gnp_random_graph() function of networkx
Graph = nx.gnp_random_graph(10, 0.5, directed=True)
nx.draw(Graph, with_labels=True, node_color='green') #draw the network graph
plt.figure(figsize=(15,10))