Giter Site home page Giter Site logo

dijkstra's Introduction

Native Python implementation of Dijkstra's algorithm.

https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

This implementation (at its current phase) does not include a priority queue.

Usage:

  1. Directly from terminal: python dijkstra.py A B C

  2. From ipython: %run dijkstra.py A B C

Arguments:

  1. A: This is the execution mode. It can take 2 values, namely 0 which means that the script will use as graph the one stored in graph.csv file, and 1 which means that a random graph (in the form of a random symmetric numpy array of integers) will be used.

  2. B: the source node (as integer)

  3. C: the target node (as integer)

Example: for a graph with N = 10 nodes stored in graph.csv file, source = 0 and target = 5 the execution command will be (from within ipython):

%run dijkstra.py 0 0 5

Performance:

So far the algorithm was tested on graphs with different sizes, with the largest one having 10000 nodes and the corresponding adjacency matrix having 10^8 values. For this graph, the execution time was approximately 47 seconds. It's pretty slow right now but it will be faster :-)

dijkstra's People

Contributors

deanone avatar

Watchers

 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.