-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdijkstraalgorithm.h
42 lines (31 loc) · 902 Bytes
/
dijkstraalgorithm.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
#ifndef DIJKSTRAALGORITHM_H
#define DIJKSTRAALGORITHM_H
#include "dnode.h"
#include "fibheapdijkstra.h"
#include <QString>
#include <QFile>
#include <limits>
template <class Node, class EdgeTemplate>
class DijkstraAlgorithm
{
public:
DijkstraAlgorithm();
~DijkstraAlgorithm();
void loadGraph(QString &fileName);
// void loadGraph(QString fileName);
void doAlg();
void printResaults();
void setIndex(int index) { sIndex = index; }
int getNodeCount() { return Nodes.count(); }
private:
Node reflect; // reflect is for function overloading (reflection workaround)
int sIndex;
protected:
// START graph
QVector<EdgeTemplate *> Edges;
QVector<Node *> Nodes;
// END graph
void doAlg(DNode, int sourceIndex); // daj mogoce raje inline
void doAlg(DFNode, int sourceIndex); // daj mogoce raje inline
};
#endif // DIJKSTRAALGORITHM_H