Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Geospatial Data Science Quick Start Guide

You're reading from   Geospatial Data Science Quick Start Guide Effective techniques for performing smarter geospatial analysis using location intelligence

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781789809411
Length 170 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Abdishakur Hassan Abdishakur Hassan
Author Profile Icon Abdishakur Hassan
Abdishakur Hassan
Jayakrishnan Vijayaraghavan Jayakrishnan Vijayaraghavan
Author Profile Icon Jayakrishnan Vijayaraghavan
Jayakrishnan Vijayaraghavan
Arrow right icon
View More author details
Toc

Shortest path analyses on the road network graph

In this section, we will be performing some of the analyses that we did earlier on the new graph, such as the following:

  • Dijkstra's shortest path analysis
  • Dijkstra's shortest path cost
  • Single-source Dijkstra's path length

Dijkstra's shortest path analysis

We have waited so long to perform the shortest path analysis on our graph. So, without further ado, let's run the shortest path algorithm on our graph, optimizing for time. To run the shortest path algorithm, we need to know the source node ID and target node ID. Here, our node IDs are coordinates. Right now, let's pick the node IDs randomly:

nodelist = list(G.nodes())
import random
random.seed...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image