Artificial Intelligence, Data Science, Machine Learning, Programming, Technology.
'Hyderabad'), ('Chennai', 'Jaipur')] G.add_edges_from(city_graph) nx.draw(G,with_labels = True) The code is easy peasy Create an undirected or directed graph using nx.Graph() or nx.DiGraph() Get a list of tuples representing edges between 2 nodes Add these edges to the Graph object using