How to do it...

Let's start using our BFS algorithm to determine whether there are any direct flights between SFO and SEA:

subsetOfPaths = graph.bfs(
fromExpr = "id = 'SEA'",
toExpr = "id = 'SFO'",
maxPathLength = 1)

display(subsetOfPaths)

As you can tell from the output, there are many direct flights between Seattle (SEA) and San Francisco (SFO):

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset