Skip to content

Glossary: Algorithms Beyond the Basics in Go

Route rebuilding (cameFrom)

Also written: cameFrom, rebuilding the choice

Recording where each answer came from so you can recover the actual route or choice, not just its total. Dijkstra follows `cameFrom` back from the goal, and the knapsack walks back up its table rows.

Where the book teaches it

Related terms

Dijkstra's algorithm0/1 knapsack