# Documentation

:: (Ord a, Ord c, Num c) | |

=> (a -> Set a) | The graph we are searching through, given as a function from vertices to their neighbours. |

-> (a -> a -> c) | Distance function between neighbouring vertices of the graph. This will never be applied to vertices that are not neighbours, so may be undefined on pairs that are not neighbours in the graph. |

-> (a -> c) | Heuristic distance to the (nearest) goal. |

-> (a -> Bool) | The goal, specified as a boolean predicate on vertices. |

-> a | The vertex to start searching from. |

-> Maybe [a] | An optimal path, if any path exists. |

This function computes an optimal (minimal distance) path through a graph in a best-first fashion, starting from a given starting point.