-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsph.h
47 lines (34 loc) · 1.55 KB
/
sph.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
/***************************************************************************
sph.h - description
-------------------
begin : Thu Sep 14 2005
copyright : (C) 2005 by Knut-Helge Vik
email : knuthelv@ifi.uio.no
***************************************************************************/
#ifndef GRAPHALGO_SHORTEST_PATH_HEURISTIC_KHV
#define GRAPHALGO_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 ShortestPathHeuristic : SteinerHeuristic
{
private:
TreeStructure &T_sph; // Stores the SPH tree
public:
ShortestPathHeuristic(const TreeStructure &in, TreeStructure &out) : SteinerHeuristic(in), T_sph(out) {}
~ShortestPathHeuristic() { }
typedef pair<vector<int>, int> PathVector;
// SPH main
void Algorithm(vertex_descriptorN zsource);
// SPH helper functions
void ExtractClosestZ(PathVector &newPath);
void AddTreeSPH(PathVector &newPath);
void FindPath(PathVector &newPath, vertex_descriptorN tree_vert, vertex_descriptorN z_vert, const ParentVector &zparent);
// experimented using prim MST -- not too good :)
//void ExtractClosestZ_prim(PathVector &newPath);
//double FindPathDistance_prim(PathVector &newPath, vertex_descriptorN tree_vert, vertex_descriptorN z_vert, ParentVector zparent, DistanceVector zdistance);
};
#endif /* GRAPHALGO_SHORTEST_PATH_HEURISTIC_KHV */