In [1]:
import networkx as nx
%matplotlib inline
import pylab
pylab.rcParams['figure.figsize'] = (10.0, 8.0)

In [3]:

E1.1 Explore the graph AG using the methods:

  • AG.nodes()
  • AG.edges()
  • AG.number_of_nodes()


Draw the graph using nx.draw

E1.2 Find out the average distance between all pairs of airports in AG

E1.3 Find out which airport in AG has the highest number of neighbours.

E1.4 Now remove that node from AG, and redo E1.2.

In [ ]: