Skip to content

welmends/DijkstraAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dijkstra Algorithm

Implementation of Dijstra Algorithm

runDijkstra

Getting Started

This repository provides an C/C++ implementation of Dijstra Algorithm

Prerequisites

  • C99 (or any GCC version)

Compilation

  • Enter into the repository folder and type the following commands:
make clean
make
  • All the executables files will be generated

Running

Here we tell how to run this program

  • Call the executable by typing at terminal on project folder
./ep1.o <path_to_txtFile>/filename.txt
  • The .txt file must have the following pattern

               n   m   s   t
               u1  v1  c1
               u2  v2  c2
                     . . .
               um vm cm

where,
              n is the vertices number;
              m is the arrows number;
              s is the origin vertice;
              t is the destination vertice;
              ui and vi are the origin and destination of the arrow i;
              ci is the cost of the arrow i.

Behavior

For an input as follows:

./ep1.o example1.txt

Ilustration

We have the following output:

> Digraph:
5 7
1 2 5
1 5 10
2 3 4
2 4 13
2 5 2
3 4 7
5 4 6

> Minimum Path [1 to 4]: [1]->[2]->[5]->[4]

About

Dijkstra Algorithm Implementation in C

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published