AlgoPlus v0.1.0
Loading...
Searching...
No Matches
hill_climbing< T > Class Template Reference

hill climbing class More...

#include <hill_climbing.h>

Public Member Functions

 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

Detailed Description

template<typename T>
class hill_climbing< T >

hill climbing class

Constructor & Destructor Documentation

◆ 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
vunordered_map<T, pair<T, double> > initializer vector. Default = {}
nodesunordered_map<T, double> initializer values for the nodes. Default = {}

Member Function Documentation

◆ add_edge()

template<typename T>
void hill_climbing< T >::add_edge ( T u,
T v )
inline

add_edge function

Parameters
uthe first node
vthe second node

◆ has_edge()

template<typename T>
bool hill_climbing< T >::has_edge ( T u,
T v )
inline

has_edge function

Parameters
uthe first node
vthe second node
Returns
true if there exist an edge between u and v
false otherwise

◆ insert_node()

template<typename T>
void hill_climbing< T >::insert_node ( T u,
double val )
inline

insert_node function

Parameters
uthe node ID
valthe heuristic value of node u

◆ search()

template<typename T>
bool hill_climbing< T >::search ( T start,
T end )
inline

search function

Parameters
startstarting node
endend node
Returns
true if search found the end node.
false otherwise

The documentation for this class was generated from the following file: