I have an assignment where I have to create a graph using the random library with for loops and also compute the probability whether there is an edge between two vertices. The body of the code is as given below.
How can I construct an graph?
# generate edges in G_rand at random:
for i in range(0,k) :
for j in range(0,i) :
# Add an edge between vertices i and j, with probability edge_probab
# ...
