-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTGraph.h
executable file
·46 lines (39 loc) · 1.13 KB
/
TGraph.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
#ifndef TGRAPH
#define TGRAPH
#include <unordered_map>
#include <algorithm>
#include <iostream>
#include <cstdint>
#include <fstream>
#include <limits>
#include <vector>
#include <queue>
#include <cmath>
#include <set>
#include <map>
typedef struct {
std::vector<uint32_t> v;
double lenght;
} route;
class TGraph
{
public:
//typedef std::pair <long int, double> arc;
TGraph (const std::string &fnodes, const std::string &fedges, const std::string &graph);
TGraph (const std::string &fnodes, const std::string &fedges);
TGraph (const std::string &fgraph);
~TGraph () {};
void Preprocessing (const std::string &file);
void InsertNode (uint32_t id, double lat, double lon);
void InsertEdge () {};
bool At (uint32_t id);
route AStar (uint32_t start, uint32_t finish);
double Dijkstra(uint32_t start, uint32_t finish);
private:
std::unordered_map <uint32_t, uint32_t> pointers;
std::vector <std::pair <uint32_t, std::pair <double, double>>> nodes;
std::vector <uint32_t> prefix;
std::vector <uint32_t> incident;
std::vector <double> weight;
};
#endif