Graph theory
What is Graph Theory?
import networkx as nx
import matplotlib.pyplot as plt
G = nx.DiGraph(directed=True)
Vertex=["London","Toronto","Seattle","New York","Berlin","Johanesburg"]
G.add_edge(Vertex[0],Vertex[1])
G.add_edge(Vertex[1],Vertex[2])
G.add_edge(Vertex[2],Vertex[4])
G.add_edge(Vertex[4],Vertex[1])
G.add_edge(Vertex[5],Vertex[3])
G.add_edge(Vertex[3],Vertex[1])
nx.draw(G, with_labels=True)
plt.show()