Code Monkey home page Code Monkey logo

dijkstra's Introduction

Dijkstra

Description ๐Ÿ

  • C Implementation of Dijkstra's shortest path algorithm.
  • Programming assignment II of Bilkent University CS473/573 Course.

Content

  • assignment2.pdf: Programming assignment description for the partA and partB problems.
  • max_heap.h: .h file for the max heap.
  • min_heap.h: .h file for the min heap.
  • partA.c: Dijkstra with min-priority queue for computing compute weakness values of the least weak paths from a given source vertex to all other vertices.
  • partB.c: Dijkstra with max-priority queue for computing success probabilities of most reliable paths between a given source vertex and all other vertices.
  • Makefile: The makefile to automate the compilation process.
  • assignment2_data: Folder containing The Matrix Market (.mtx) files to test the Dijkstra implementations.

Program

Compilation and running the program:

> make # Generates a binary executable files called A and B
> ./A input graph.mtx # Produces an output file called a.txt
> ./B input graph.mtx # Produces an output file called b.txt

The Matrix Market (.mtx) format for storing a directed, weighted graph:

% Comment lines
50 50 230 % #Vertices #Vertices #Edges
1 3 0.5 % Source Destination Weight
3 5 0.4
...

The program output:

0.0 % Distance from vertex 1 to vertex 1
0.8 % Distance from vertex 1 to vertex 2
0.6 % Distance from vertex 1 to vertex 3
-1 % No path from vertex 1 to vertex 4
0.7
...

dijkstra's People

Contributors

zeynepcankara 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.