Bundle Classic AI algorithms: graph search, adversarial game search, optimization and tabular reinforcement learning (-lib ai)
Dijkstra
Dijkstra's single-pair shortest path over non-negative edge weights.
Example
result := Dijkstra->FindPath(graph, 0, 5);
if(result->Found()) {
result->GetCost()->PrintLine();
};Operations
FindPath # function
Finds the minimum-cost path between two nodes.
function : FindPath(graph:Graph, start:Int, goal:Int) ~ SearchResultParameters
| Name | Type | Description |
|---|---|---|
| graph | Graph | graph to search |
| start | Int | start node id |
| goal | Int | goal node id |
Return
| Type | Description |
|---|---|
| SearchResult | search result |