Networkx import networkx as nx
import matplotlib.pyplot as plt
G = nx.complete_graph(N) # Creates a graph of N vertices
G = nx.gnp_random_graph(N1, N2) # Creates graph of N1 vertices & probability N2 of forming edge
G = nx.Graph() # Creates a undirected graph
G.add_node(N) # Adds a node to the graph
G.add_edge(N1, N2) # Adds a edge between nodes
print(G.order()) # Prints number of nodes
print(G.size()) # Prints number of edges
print(G.nodes()) # Prints all the nodes
print(G.edges()) # Prints all the edges
nx.draw(G, with_labels=1)
plt.show()