Lecture 6: AI Search Algorithms
Lecture 6 introduces informative and non-informative space search algorithms, particularly in the context of Artificial Intelligence [1]. The lecture uses the scenario of a Mars rover needing to navigate to a specific rock to illustrate the concepts [2]. Due to signal delays, the rover cannot be controlled in real-time, so it must autonomously find its way [2].
Here's a summary of the key aspects covered:
State Space Search: This involves representing possible paths as a graph, G(V, E), where V is a set of vertices representing the possible states of a system, and E is a set of edges representing transitions between neighboring states [3].
Edges in the graph can be directed, restricting adjacency and transitions [4].
Edges can also have weights, representing costs, with rewards represented as negative costs [4].
These attributes can be combined to form a directed weighted graph [5].
Trees and Graphs: A tree over a state space enumerates all valid paths from a starting state (root). Each layer in the tree corresponds to a valid state, and the branches represent possible transitions [5].
State Space Search Problem: Given a graph G(V, E) and a root vertex v0, the goal is to select a sequence of states (vertices) to reach a target point while satisfying constraints and criteria over the trajectory [6]. This involves enumerating candidate sequences of actions and testing them against criteria like edge distance or weight [7].
Traversal Algorithms: One approach to solving the state space search problem is to use a traversal algorithm to explore the graph structure and enumerate a tree containing feasible solutions [7]. As candidate solutions are created, the best solution that satisfies the search constraint (shortest path, lowest cost, etc.) can be selected [8].
Breadth-First Search (BFS):
It is a common method of graph traversal [9].
BFS visits every vertex of a graph using queues [9].
The algorithm places the root vertex into a priority queue and adds all neighboring nodes to the queue [8, 10]. The highest priority vertex is removed from the queue, marked as visited, and expanded by considering each undiscovered edge in turn [10]. This process continues until all nodes are visited [11, 12].
BFS visits sibling vertices before child vertices [13].
A starting node of the graph is marked as visited and enqueued into the queue [13]. While the queue is not empty, the next node is dequeued from the queue to become the current node [13]. While there is an unvisited child of the current node, the child is marked as visited and enqueued into the queue [14].
Depth-First Search (DFS):
Uses a recursive algorithm [15].
DFS expands the first neighbor of a vertex, then its first neighbor, and so on, using a recursive call [15].
DFS places the root vertex into a stack [16]. The first neighboring node of the root is added to the queue [16]. This process continues until all nodes are visited [17, 18].
DFS will visit the child vertices before visiting siblings [19].
A given node is considered the parent and connected nodes a child [20].
The starting node of the graph is marked as visited and pushed onto the stack [19]. While the stack is not empty, the top node on the stack is peeked at [19]. If there is an unvisited child of that node, the child is marked as visited and pushed onto the stack [19]. Otherwise the top node is popped off the stack [19].
Best-First Search:
A simple algorithm for searching in a weighted graph [21]. It is also called Dijkstra’s single path algorithm [21, 22].
At each iteration, the "best" node is expanded [21, 22]. If the task is to find a path with the lowest cumulative value, the node with the lowest cumulative value is expanded before any other [23].
The root node is placed into the queue [24]. If the queue is empty, the algorithm stops and returns failure [24]. If the first element of the queue is the goal node, the algorithm stops and returns success [24]. Otherwise, the first element is removed from the queue, expanded, and the estimated goal distance is computed for each child [24]. The child is placed in the queue in ascending order to the goal distance [24].
A* Search:
A popular informed search algorithm commonly used in games [25].
A* is widely used for solving sequential decision problems in domains that can be represented by a graph [25].
A* search realizes a best-first search with an evaluation function: f(n) = g(n) + h(n), where g(n) is the path length from the root to n, and h(n) is the heuristic prediction of the cost from n to the goal [26, 27].
A* augments Dijkstra’s algorithm by using an estimate on the cost of a path passing through a vertex vi [28, 29].
The algorithm uses a priority queue ordered on total cost, f(vi) [28]. It also uses two lists of vertices: Open (vertices at the horizon, to be explored) and Closed (already explored vertices) [28].
The lecture also mentions that there are many online resources for learning about search algorithms, including A*, and recommends the textbook "Artificial Intelligence: A Modern Approach" by Stuart Russell and Peter Norvig [29].