-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsph.h
52 lines (39 loc) · 1.84 KB
/
rsph.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
/***************************************************************************
rsph.h - description
-------------------
begin : Thu Jul 26 2007
copyright : (C) 2005 by Knut-Helge Vik
email : knuthelv@ifi.uio.no
***************************************************************************/
#ifndef GRAPHALGO_RANDOMIZED_SHORTEST_PATH_HEURISTIC_KHV
#define GRAPHALGO_RANDOMIZED_SHORTEST_PATH_HEURISTIC_KHV
#include "steiner_class.h"
#include "../treealgs/treestructure.h"
#include "../treealgs/treealgs.h"
using namespace boost;
using namespace std;
using namespace TreeAlgorithms;
class RandomizedSPH : SteinerHeuristic
{
private:
TreeStructure &T_sph; // Stores the SPH tree
public:
RandomizedSPH(const TreeStructure &in, TreeStructure &out) : SteinerHeuristic(in), T_sph(out), D(0), depth(num_vertices(in.g)), algo(GlobalSimArgs::getSimTreeAlgo()) {}
~RandomizedSPH() { }
typedef pair<vector<int>, int> PathVector;
// SPH main
void Algorithm(vertex_descriptorN zsource, const double &dDB);
// SPH helper functions
bool ExtractClosestZ(PathVector &newPath);
bool AddTreeSPH(PathVector &newPath);
void FindPath(PathVector &newPath, vertex_descriptorN tree_vert, vertex_descriptorN z_vert, const ParentVector &zparent);
bool FindPath(PathVector &newPath, vertex_descriptorN tree_vert, vertex_descriptorN z_vert, const ParentVector &zparent, TreeAlgo algo);
bool FindPathRGH(PathVector &newPath, vertex_descriptorN tree_vert, vertex_descriptorN z_vert, const ParentVector &zparent);
bool FindPathRH(PathVector &newPath, vertex_descriptorN tree_vert, vertex_descriptorN z_vert, const ParentVector &zparent);
private:
double D;
DistanceVector depth;
VertexSet vertsWithinDB;
TreeAlgo algo;
};
#endif /* GRAPHALGO_SHORTEST_PATH_HEURISTIC_KHV */