liveBook · Manning

Path

As explained in Grokking AI Algorithms, Second Edition

A path is an ordered sequence of steps or transitions leading from an initial situation toward a goal.

A path is an ordered sequence of nodes and edges connecting a starting point to a goal. In a maze, it records the moves needed to reach the destination. section 2.7

Search problems compare possible paths toward a goal. One path may be shorter, cheaper to execute, or otherwise better for the situation. section 1.8

A path connects the following tree concepts:

  • Nodes represent positions or states. section 2.7
  • Edges represent connections between nodes. section 2.7
  • A parent link records the node from which a neighbor was reached, allowing the route to be traced back toward the start. section 2.10

Tracing a maze path with BFS

Breadth-first search explores a maze with a queue. After discovering an unvisited neighbor, it marks the neighbor, stores the current node as its parent, and enqueues it. When the goal is found, following parent links backward reconstructs the path from the goal to the starting point. section 2.10 section 2.7

Figure 2.13 A solution to the maze problem represented as a tree

Visualize a maze solution as a tree path from the start point to the goal. section 2.7

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Defines paths through nodes and edges, then shows parent links reconstructing a maze route during breadth-first search.
Examples
Uses maze routes, a nine-node tree path, city routes, and parent pointers in a BFS implementation.
What it assumes
Assumes basic search vocabulary while defining nodes, edges, parents, children, ancestors, descendants, and trees.
What you can do after
Apply parent links from breadth-first search to reconstruct a route from a discovered goal back to its start.
How it connects
Connects paths to trees, nodes, edges, goals, search problems, and breadth-first search.

Also explained in

Compare how 4 books explain path →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.