How to do it...

Execute the following code snippet to determine the most important airport in our dataset via the PageRank algorithm:

# Determining Airport ranking of importance using `pageRank`
ranks = graph.pageRank(resetProbability=0.15, maxIter=5)
display(ranks.vertices.orderBy(ranks.vertices.pagerank.desc()).limit(20))

As you can see from the output in the following graph, Atlanta, Dallas, and Chicago are the top three most important cities (note that this dataset contains US data only):

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

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