libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
graphAlgorithms.h
1 #ifndef GRAPHALGORITHMS_H
2 #define GRAPHALGORITHMS_H
3 
4 #include "GraphInterface.h"
5 #include <vector>
6 #include <deque>
7 #include <map>
8 
9 
10 using namespace std;
11 namespace mho {
12 
25 std::vector<std::pair<cost_t,std::vector<NodeInterface*> > > enumerate_paths(GraphInterface *g, NodeInterface *x, NodeInterface *destination, cost_t max_cost);
29 std::vector<std::pair<cost_t,std::vector<NodeInterface*> > > enumerate_paths(GraphInterface *g, NodeInterface *x, NodeInterface *destination=0);
30 pair<cost_t, vector<NodeInterface *> > random_path(GraphInterface *g, NodeInterface *x, NodeInterface *destination,cost_t max_cost);
34 pair<cost_t, vector<NodeInterface *> > random_path(GraphInterface *g, NodeInterface *x, NodeInterface *destination);
35 
36 std::pair<cost_t,std::deque<NodeInterface*> > dijkstra(GraphInterface *g,NodeInterface* n1,NodeInterface* n2);
37 std::pair<cost_t,std::vector<NodeInterface*> > dijkstra(GraphInterface *g,NodeInterface* n1,NodeInterface* n2,bool vect);
38 
40 public:
42  void setGraph(GraphInterface *g);
43  void setTarget(NodeInterface *target);
44  NodeInterface* getTarget(){return target;}
45  void compute(NodeInterface *target);
46  void compute();
47  std::pair<cost_t,std::deque<NodeInterface*> > getPathDeque(NodeInterface *start);
48  std::pair<cost_t,std::vector<NodeInterface*> > getPathVector(NodeInterface *start);
49 
50 private:
51  GraphInterface *g;
52  NodeInterface *target;
53  std::map<NodeInterface*,cost_t> dist;
54  std::map<NodeInterface*,NodeInterface*> pred;
55 };
56 
57 
58 }
59 #endif // GRAPHALGORITHMS_H
Definition: graphAlgorithms.h:39
Definition: NodeInterface.h:11
template interface for a graph
Definition: GraphInterface.h:13