GithubHelp home page GithubHelp logo

deenuy / dijkstra-algo-shortest-path Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 17 KB

Dijkstra's Algorithm for finding shortest path between two cities using PriorityQueues and list nearby cities for given distance k.

Java 100.00%
java priority-queues graph-theory data-structures-and-algorithms

dijkstra-algo-shortest-path's Introduction

Dijkstra-algo-shortest-path

Dijkstra's Algorithm for finding shortest path between two cities using PriorityQueues and list nearby cities for given distance k. Assumes all distances are non-negative.

Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of vertices (also called nodes or points) which are connected by edges (also called links or lines).

Implementations of graph algorithms:

  • Read CSV and create graph with vertices/ nodes and edges using HashMap<String, List>
  • Add static method, shortestPath(Graph graph, String from, String to), returning a List of cities visited, from source to the destination, followed by total distance between cities (km)
  • Add static method, nearby(Graph graph, String origin, double distance), returning a List of cities with the corresponding distances, for given distance (eg: k=100)

Input file is provided in CSV format, based on Ontario map, listing cities and distances.

Citations for code adoption:

  • Sedgewick, R., Wayne, K. (2011). Algorithms, 4th Edition. Addison-Wesley. ISBN: 978-0-321-57351-3
  • Goodrich, M. T., Tamassia, R. (2014). Data Structures and Algorithms in Java, 6th Edition. John Wiley & Sons. ISBN: 0-471-38367-8

dijkstra-algo-shortest-path's People

Contributors

deenuy avatar

Stargazers

 avatar

Watchers

 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.