forked from vicentebolea/dijkstra_binaryHeap_cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dijkstra.h
55 lines (43 loc) · 1000 Bytes
/
dijkstra.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Assignment 5 for CSE231 Data Structures
*
* 2012. 10. 8
*
* FILE: dijkstra.h
* DESCRIPTION: Class Dijkstra, this class contain
* the declaration and definition of the class
* where is implement Dijkstra ADT.
* This class solve the dijstra's algorithm
* using a binary heap implementation
*
* AUTHOR: Vicente Adolfo Bolea Sanchez
* STUDENT NO: 20122901
* EMAIL: [email protected]
*/
#ifndef DIJKSTRA_H
#define DIJKSTRA_H
#include "adjacencyList.h"
#include <iostream>
#include <fstream>
#include <limits>
using namespace std;
class Dijkstra {
public:
Dijkstra();
~Dijkstra();
void ReadGraph(const char* file);
void FindPath(const int v0, const int v1);
private:
int vertices, edges;
//Data structures
adjacencyList* al;
MinHeap heap;
//Arrays
float* dist;
int* previous;
bool* visited;
//privated methods
void dumpFile(std::fstream&, int, int);
void print_result(const int, const int);
};
#endif