concept

State space and transitions

A deterministic search model describes states, allowed actions, transitions, start, goals and costs. Directed edges need not be reversible.

Formal Syntax & Structure

artificial-intelligence syntaxartificial-intelligence
successors(state) → reachable next states; goal_test(state) → Boolean

Working Example

Example Snippetartificial-intelligence
def successors(graph, state):    return list(graph[state])
def is_goal(state, goal):    return state == goal
graph = {"A": {"B": 2, "C": 5}, "B": {"A": 2, "C": 1}, "C": {}, "D": {}}print(successors(graph, "A"))print(successors(graph, "C"))print(is_goal("C", "C"))