search_algorithms

Values

pub fn a_star(
  get_next_states: fn(state) -> List(state),
  get_next_cost: fn(state, state) -> Int,
  approx_remaining_cost: fn(state) -> Int,
  has_found_end: fn(state) -> Bool,
  initial: state,
) -> Result(#(Int, List(state)), Nil)
pub fn a_star_assoc(
  get_next_states: fn(state) -> List(#(state, Int)),
  approx_remaining_cost: fn(state) -> Int,
  has_found_end: fn(state) -> Bool,
  initial: state,
) -> Result(#(Int, List(state)), Nil)

A* w/ associated transition costs

pub fn breadth_first(
  next next: fn(state) -> List(state),
  found found: fn(state) -> Bool,
  initial initial: state,
) -> Result(List(state), Nil)

Breadth First Search

pub fn depth_first(
  next: fn(state) -> List(state),
  found: fn(state) -> Bool,
  initial: state,
) -> Result(List(state), Nil)

Depth First Search

pub fn dijkstra(
  get_next_states: fn(state) -> List(state),
  get_next_cost: fn(state, state) -> Int,
  has_found_end: fn(state) -> Bool,
  initial: state,
) -> Result(#(Int, List(state)), Nil)

Dijkstra

pub fn dijkstra_assoc(
  get_next_states: fn(state) -> List(#(state, Int)),
  has_found_end: fn(state) -> Bool,
  initial: state,
) -> Result(#(Int, List(state)), Nil)

Dijkstra w/ associated transition costs

Search Document