91 std::priority_queue<std::pair<T, double>, std::vector<std::pair<T, double> >, std::greater<std::pair<T, double> > > q;
+
+
+
+
+
91 std::unordered_map<T, bool> visited;
+
92 std::priority_queue<std::pair<T, double>, std::vector<std::pair<T, double> >, std::greater<std::pair<T, double> > > q;
+
93 q.push({start, nodes[start]});
+
94 visited[start] =
true;
+
+
96 int64_t size = q.size();
+
97 for(int64_t i = 0; i<size; i++){
+
98 std::pair<T, double> current = q.top();
99 if(current.first == end){
@@ -181,12 +181,12 @@
-
best first class
Definition best_first.h:14
-
void add_edge(T u, T v)
add_edge function
Definition best_first.h:65
-
best_first(std::unordered_map< T, std::vector< std::pair< T, double > > > v={})
best_first constructor
Definition best_first.h:26
-
bool has_edge(T u, T v)
has_edge function
Definition best_first.h:49
-
void insert_node(T u, double val)
insert_node function
Definition best_first.h:37
-
bool search(T start, T end)
search function
Definition best_first.h:86
+
best first class
Definition best_first.h:15
+
void add_edge(T u, T v)
add_edge function
Definition best_first.h:66
+
best_first(std::unordered_map< T, std::vector< std::pair< T, double > > > v={})
best_first constructor
Definition best_first.h:27
+
bool has_edge(T u, T v)
has_edge function
Definition best_first.h:50
+
void insert_node(T u, double val)
insert_node function
Definition best_first.h:38
+
bool search(T start, T end)
search function
Definition best_first.h:87