Giter Site home page Giter Site logo

djikstra_shortest_path's Introduction

Djıkstra shortest path with open street maps data

About:

A shortest path algorithm in djikstra (or something like it) implemented with open streets maps data It's written in python 3.8 using only the std library.

Design process:

Initially I tried to do this with a very greedy algorithm (I always took the shortest distanced path) but that didn't work so well... :D

I approached the problem like the above because I thought that dijkstra was going to give me some stackoverflow errors with this dataset, and while trying to do A*, I had some problems determining the estimate functions.

But after completing the extremely greedy algo, I realised that it was not the optimal soln. (It returned the distance way larger than it should + it took too long), I debugged it for a while, then decided to give dijkstra a shot, and if needed some; optimisation.

Well, I'm writing this because dijkstra works 🎉 with the example dataset.

Assumptions:

  • I don't know if this code would work with a larger dataset. As far as I'm aware is that it should, so I assumed the computer executing this would have enough RAM.
  • I assumed that there won't be any junk data after the edges, but still included the slicing for it in the end.

Dependencies:

python 3.8 shell

How to run:

  • With python: python main.py <start_vertex> <end_vertex>

djikstra_shortest_path's People

Contributors

selinfildis avatar

Stargazers

Roman avatar Fatih Yavuz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.