"So the itinerary between Indianapolis and Fairbanks with the fewest number of flights passes through Boston and Seattle."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# EXERCISE 3\n",
"\n",
"Is it possible to travel from any airport in the US to any other airport in the US, possibly using connecting flights? In other words, does there exist a path in the network between every possible pair of airports?"
"The graph contains multiple connected components, so it is not possible to fly from any airport in the US to any other airport in the US (possibly using connecting flights)."
So the itinerary between Indianapolis and Fairbanks with the fewest number of flights passes through Boston and Seattle.
%% Cell type:markdown id: tags:
# EXERCISE 3
Is it possible to travel from any airport in the US to any other airport in the US, possibly using connecting flights? In other words, does there exist a path in the network between every possible pair of airports?
%% Cell type:code id: tags:
``` python
components=list(nx.connected_components(G))
len(components)
```
%% Cell type:markdown id: tags:
The graph contains multiple connected components, so it is not possible to fly from any airport in the US to any other airport in the US (possibly using connecting flights).