aoc2018-0.1.0.0: Advent of Code 2018 solutions and auto-runner

Safe HaskellNone
LanguageHaskell2010

AOC.Common.Search

Synopsis

Documentation

aStar Source #

Arguments

:: (Ord n, Ord p, Num p) 
=> (n -> p)

heuristic

-> (n -> Map n p)

neighborhood

-> n

start

-> n

target

-> Maybe [n]

the shortest path, if it exists

A* Search

binaryMinSearch :: (Int -> Bool) -> Int -> Int -> Maybe Int Source #

Find the lowest value where the predicate is satisfied within the given bounds.

exponentialMinSearch :: (Int -> Bool) -> Int -> Maybe Int Source #

Find the lowest value where the predicate is satisfied above a given bound.

binaryFindMin :: (Int -> Maybe a) -> Int -> Int -> Maybe a Source #

Find the lowest value where the predicate is Just within the given bounds.

exponentialFindMin :: (Int -> Maybe a) -> Int -> Maybe a Source #

Find the lowest value where the predicate is Just above a given bound.