hill climbing class
More...
#include <hill_climbing.h>
|
| hill_climbing (std::unordered_map< T, std::vector< std::pair< T, double > > > v={}, std::unordered_map< T, double > nodes={}) |
| hill_climbing constructor
|
void | insert_node (T u, double val) |
| insert_node function
|
bool | has_edge (T u, T v) |
| has_edge function
|
void | add_edge (T u, T v) |
| add_edge function
|
bool | search (T start, T end) |
| search function
|
template<typename T>
class hill_climbing< T >
hill climbing class
◆ hill_climbing()
template<typename T>
hill_climbing< T >::hill_climbing |
( |
std::unordered_map< T, std::vector< std::pair< T, double > > > | v = {}, |
|
|
std::unordered_map< T, double > | nodes = {} ) |
|
inlineexplicit |
hill_climbing constructor
- Parameters
-
v | unordered_map<T, pair<T, double> > initializer vector. Default = {} |
nodes | unordered_map<T, double> initializer values for the nodes. Default = {} |
◆ add_edge()
add_edge function
- Parameters
-
u | the first node |
v | the second node |
◆ has_edge()
has_edge function
- Parameters
-
u | the first node |
v | the second node |
- Returns
- true if there exist an edge between u and v
-
false otherwise
◆ insert_node()
insert_node function
- Parameters
-
u | the node ID |
val | the heuristic value of node u |
◆ search()
search function
- Parameters
-
start | starting node |
end | end node |
- Returns
- true if search found the end node.
-
false otherwise
The documentation for this class was generated from the following file:
- /Users/runner/work/AlgoPlus/AlgoPlus/src/machine_learning/search_algorithms/hill_climbing/hill_climbing.h