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

SearchResult

Result of a graph search: whether the goal was reached, the node path from start to goal, its cost, and how many nodes were expanded.

Operations

Found #

Whether a path to the goal was found.

method : public : Found() ~ Bool

Return

TypeDescription
Booltrue if found

GetCost #

Gets the total path cost (sum of edge weights; hop count for the unweighted searches; 0.0 when not found).

method : public : GetCost() ~ Float

Return

TypeDescription
Floatpath cost

GetExpanded #

Gets the number of nodes expanded during the search.

method : public : GetExpanded() ~ Int

Return

TypeDescription
Intexpanded node count

GetPath #

Gets the path from start to goal inclusive (empty when not found).

method : public : GetPath() ~ Int[]

Return

TypeDescription
Intnode id path