Regression: Starting from the goal and working backward to the initial state
Backward search is a planning algorithm that starts from the goal and works backward toward the initial state.
Think of it like working backward from your destination: you know where you want to end up, and you figure out what steps could have gotten you there.
Let's walk through backward search step-by-step with the same robot grasping problem!
Available Actions:
Move(from, to),
Grasp(box)
Regress: Find preconditions of Grasp(Box)
Regress: Find preconditions of Move(RoomA, RoomB)
Move(RoomA, RoomB)Grasp(Box)The formal algorithm for backward state-space search:
function BACKWARD-SEARCH(problem) returns solution or failure // Initialize frontier with goal frontier ← {problem.GOAL} explored ← {} // NOTE: Similar to forward search but works backward! // We search from GOAL toward INITIAL state while frontier is not empty do // Choose a goal set from frontier g ← POP(frontier) // Check if initial state satisfies g if problem.INITIAL ⊇ g then return SOLUTION(g) // Mark goal set as explored explored ← explored ∪ {g} // Expand: find relevant actions for each action in RELEVANT-ACTIONS(g) do // Regress goal set through action predecessor ← REGRESS(g, action) // Add to frontier if not explored if predecessor ∉ explored and predecessor ∉ frontier then frontier ← frontier ∪ {predecessor} return failure
An action is relevant to goal set g if:
ggGoal: {At(Robot, RoomB)}
Compute predecessor goal set:
REGRESS(g, a) = (g - Add(a)) ∪ Precond(a)
Meaning: Remove what the action adds, and include what the action requires.
g: {Holding(Robot, Box)}
Action: Grasp(Box)
Result:
| Start: | Initial State |
| Direction: | Initial → Goal |
| States: | Ground states (concrete) |
| Actions: | Applicable (precond met) |
| Check: | Is state = goal? |
| Successor: | RESULT(s, a) |
| Best for: | Many goals, few initial states |
| Start: | Goal State |
| Direction: | Goal → Initial |
| States: | Goal sets (can have variables) |
| Actions: | Relevant (effects match goal) |
| Check: | Does initial satisfy goal? |
| Predecessor: | REGRESS(g, a) |
| Best for: | Few goals, many initial possibilities |
Begin with what you want
Find what's needed before
Check if achievable from start