v2026.6.1
All Bundles
Bundle Classic AI algorithms: graph search, adversarial game search, optimization and tabular reinforcement learning (-lib ai)

BreadthFirst

Breadth-first search: fewest-hops path, ignoring edge weights. The result cost is the hop count.

Operations

FindPath # function

Finds the fewest-hops path between two nodes.

function : FindPath(graph:Graph, start:Int, goal:Int) ~ SearchResult

Parameters

NameTypeDescription
graphGraphgraph to search
startIntstart node id
goalIntgoal node id

Return

TypeDescription
SearchResultsearch result