项目作者: renanmagagnin

项目描述 :
A c++ program that finds the shortest paths between a source node and a set of given nodes in a graph with costs in edges and nodes.
高级语言: C++
项目地址: git://github.com/renanmagagnin/graph-theory-assignment.git
创建时间: 2019-06-14T00:33:08Z
项目社区:https://github.com/renanmagagnin/graph-theory-assignment

开源协议:

下载


A C++ Implementation of Dijkstra’s Shortest Path Algorithm in Double-Weighted Graphs

The program receives an input file containing the description of the double-weighted graph and a list of destination nodes. The output is a list of the minimum distances from the first node to each destination node.



Usage

A makefile is included for the compilation of all source files and a formatted .txt input file should be redirected into the ouput program.

To run the program, first run the makefile and then invoke the output program with the desired input file:

  1. make
  2. ./output < inputFile.txt




The input file should respect the following format:

  1. 5 <= Number of nodes in the graph
  2. 2 4 5 <= List of destination nodes
  3. 1 1 100 2 2 <= Weights of the nodes, in order.
  4. -1 2 1 3 -1 <= Weigths of the edges from Node 1 to every other node. (-1s indicate the absence of an edge)
  5. 2 -1 3 -1 -1 <= Weigths of the edges from Node 2 to every other node. (-1s indicate the absence of an edge)
  6. 1 3 -1 1 2 <= Weigths of the edges from Node 3 to every other node. (-1s indicate the absence of an edge)
  7. 3 -1 1 -1 4 <= Weigths of the edges from Node 4 to every other node. (-1s indicate the absence of an edge)
  8. -1 -1 2 4 -1 <= Weigths of the edges from Node 5 to every other node. (-1s indicate the absence of an edge)



Additional Resources