This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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)) |