Skip to main content
Artificial Computational Intelligence

Uninformed and Informed Search

Published: 2026-08-13
Level: postgraduate
Audience: Postgraduate students in Artificial Computational Intelligence

3.1 Search Problem Formulation Recap

3.1.1 The Five Components of a Problem

Hook: What do a road trip, a sliding puzzle, and a chess game have in common? In the early days of AI, for many years, people modeled real-world problems as search problems: define an initial state and a goal state, then apply a search technique to walk from one to the other — and the system has "done AI", it took itself to the goal. Every search algorithm in this lecture assumes the problem has already been shaped into these five components, so getting the shape right is where everything starts.

The agents that do this are called problem-solving agents (PSA). A problem-solving agent does not act on the first thing it sees; it plans ahead. It simulates sequences of actions inside a model of the world, searches until it finds a sequence that reaches the goal, and then executes that sequence for real. The sequence it finds is called a solution. The four-phase process is: goal formulation (adopt the goal), problem formulation (describe the states and actions needed to reach it), search (simulate action sequences in the model), and execution (carry the found solution out).

To model a problem this way, we must be able to produce five things for any question we are given:

  1. Initial state — where the agent starts, written . For the road trip: Arad.
  2. Goal state (or goal test) — what "done" looks like. Sometimes a single state (Bucharest); sometimes a small set; sometimes a property, as in a vacuum-cleaner world where the goal is "no dirt anywhere". A goal test answers the yes/no question "is this state a goal?" for any state.
  3. Possible actions — what the agent may do in each state. Written , it returns the finite set of actions applicable in state . Example: .
  4. Transition model — where each action leads. Written , it returns the state that results from doing action in state . Example: .
  5. Path cost — what each move costs. Written , it gives the numeric cost of applying action in state to reach state . For route finding, the cost of an action might be the road length in miles or the time it takes. Path costs are assumed additive: the total cost of a path is the sum of the individual action costs. An optimal solution is the solution with the lowest path cost among all solutions.

The professor's way of checking this: whatever question is given, you should be able to come up with these five components. Writing these five things down is what formulating a problem means.

The five-component contract. A search problem is fully described by: the initial state , the actions , the transition model , the goal test , and the action cost . The state space — the set of all reachable states plus the transitions between them — is the graph the search will move through. Search algorithms treat states as whole, atomic objects: the internal structure of a state is not visible to the search, only the five components above.

This sits on top of what was covered before: the PEAS specification (performance measure, environment, actuators, sensors), the different natures of the environment (is it partially observable? static or dynamic?), and the different types of agents (simple reflex, model-based, goal-based, utility-based, learning). A useful link back to the previous lecture: the five-component formulation only makes sense for the environments the search chapter assumes — episodic, single-agent, fully observable, deterministic, static, discrete, and known. If the world is dynamic or partially observable, the same five components still exist, but the search must be re-run or made contingent on what the agent observes.

3.1.2 Worked Examples of Formulation

Example 1 — Road trip (Arad to Bucharest). On the Romania map, if the agent is in Arad and must reach Bucharest:

  • Initial state: Arad.
  • Goal test: checks whether the agent is in Bucharest.
  • Actions: the roads out of the current city — from Arad, exactly the set of reachable cities: Sibiu, Timisoara, Zerind.
  • Transition: says which city each road leads to; .
  • Path cost: the road distance in miles (for example Arad → Sibiu = 140, Arad → Zerind = 75).

If I am in Arad, the actions are exactly the set of reachable cities, and each has its own edge cost.

Example 2 — The 8-puzzle (sliding puzzle). A 3 × 3 grid holds eight numbered tiles and one blank space; the goal is to reach a specified arrangement.

  • Initial state: any given start arrangement.
  • Goal test: does the arrangement match the target arrangement? The start state and goal state supply the first two properties by themselves.
  • Actions: the transitions are strictly constrained — the blank tile can only move up, down, left, or right. Nothing else is allowed; you cannot randomly pick up tile 7 and drop it somewhere else. From a given arrangement, only tiles 2, 5, 6, or 3 can move (down, left, right, up, depending on where the blank sits).
  • Transition: swapping the blank with the neighboring tile in the chosen direction; for example, moving the blank Left swaps it with the tile to its left.
  • Path cost: each move costs 1.

Repeating such moves generates the whole state space — the transition diagram drawn in class — and if you keep applying legal moves you eventually cover it. The 8-puzzle has 9!/2 = 181,440 reachable states, which is why its state space is small enough to draw small pieces of, and large enough to be a classic benchmark.

One subtle point about formulating problems: abstraction. The five components are a model, not the real thing. "Arad" in the model leaves out the radio program, the scenery, the weather, and the traffic — all irrelevant to finding a route. A good problem formulation removes as much detail as possible while keeping a solution easy to carry out: the action "drive from Arad to Sibiu" is useful; "move the right foot forward one centimeter" is not. Formulating a problem is an act of judgment, not just transcription.

3.1.3 Learning Outcomes and Probable Questions

The professor listed the skills this material is expected to produce, which are also the probable question types so far:

  • Given a situation (for example, "you are playing chess"), explain the environment: all the aspects from the environment taxonomy.
  • Given a situation, argue which agent architecture is best suited — is a reflex agent enough, or do you need a goal-based, utility-based, or more capable design?
  • Given a problem, formulate it using the five definitions: initial state, actions, transition, goal, and path cost.

Scope and common traps. The five-component formulation assumes additive, positive path costs — the total cost of a path is the sum of its steps, and each step costs more than zero. If an edge could be negative, the notion of "cheapest path" becomes ill-defined on cycles. Also note the difference between a tree and a graph: this course mostly deals with graphs, but a tree is a special kind of graph (one unique path between any two nodes), so every example on a tree is also a valid graph example. Finally, do not confuse the goal test (deciding whether you have arrived) with the goal state (a specific state you might arrive at) — the test is the yes/no function, the state is a particular destination.

Exam note: these are the probable learning outcomes to check yourself against: PEAS, environment judgment, agent-architecture choice, and five-component problem formulation. A likely exam question is exactly the drill above: take a situation, produce the five components, judge the environment, and argue for an agent architecture. Practice on the road trip and the 8-puzzle until the five items come out instantly.

Real-world connection: this formulation style is not classroom decoration. Route-finding web sites and in-car navigation systems are direct extensions of the Romania example — states are locations, actions are roads, costs are travel time. The same five components drive airline travel-planning systems (states there include airport and time, and the action cost mixes money, waiting time, and flight time), robot navigation (states are positions and joint angles), and touring problems such as the traveling salesperson problem, where the goal is to visit every city. Whatever the domain, the agent first needs a well-formed problem — the five components — before any of the search techniques in this lecture can start.

3.3 Breadth-First Search (BFS)

3.3.1 What BFS Does

Hook: You are told to search a tree and the goal could be anywhere. Do you charge down the first path you see, or do you sweep carefully, level by level, making sure no shallow node is missed? Breadth-first search is the cautious answer — and its caution is both its strength and its weakness.

Breadth-first search (BFS) is the more cautious of the two classic techniques: it examines paths of length before it examines paths of length . It visits a tree or graph level by level — it covers one full level, then the next, then the next. It uses a queue to do the visit, which is FIFO: first in, first out. The name says it: breadth first — cover all nodes at a given depth before proceeding to deeper nodes. All the algorithms discussed in the first part of this topic are uninformed: they only have the graph, possibly with path costs, and nothing else.

Purpose. BFS answers "is there a path to the goal, and what is the path with the fewest actions?" It is the right tool when all actions cost the same (for example, every move of the 8-puzzle costs 1) and you want the shallowest solution. It is also complete: if a solution exists at any finite depth, BFS will eventually find it, because it never skips a level.

Inputs and outputs. Input: the problem's five components (initial state, goal test, actions, transition model, path cost) with uniform step costs. Output: a solution path from the initial state to a goal, found by expanding nodes in order of increasing depth.

Because new nodes are always deeper than their parents, a FIFO queue gives exactly the right order with no extra bookkeeping: old, shallow nodes sit at the front and are expanded first; new, deep nodes join the back. The search also keeps track of reached states so that a state reached once is never reached again — without that check, a cycle like Arad → Sibiu → Arad would let the search loop forever.

3.3.2 Worked Example — Queue Trace

Worked example: BFS from A to F on a small tree. Consider a tree with root . 's children are and ; has children , and has children . The goal is , and we want to go from to . Level 0 contains ; levels 1, 2, ... hold its children. The queue works like this:

  1. Start with . Remove and ask: where all can take me? To and . Add them: . The order is not important — writing is not wrong.
  2. Remove . Where can take me? To . Add them: .
  3. Remove . Where can take me? To . Add them: .
  4. Remove . It cannot take us anywhere. Remove . Nothing either. Remove — and that is when we realize we are at the goal.

Because we removed nodes in the order they were added, every node of level 1 was removed before any node of level 2. That is why this is called breadth-first ordering — the traversal looks like: cover one level, then the next, then the next, and so on.

Sense-check: the goal appears twice in the queue (once via , once via ). BFS stops at the first it removes, which sits at depth 2 — the shallowest possible depth for , since is a child of level-1 nodes. A depth-first search could have reached via at the same depth but in a different order; BFS is the one that never looks at level 3 before finishing level 2.

A second, textbook-style view uses colors: the orange nodes have been covered (explored); the gray nodes have been generated but not yet explored — we have not gone there yet. You generate all nodes at a given depth before moving deeper. If the node we are currently at is the goal, we stop there and do not go further; exploring the goal further is unnecessary. The goal can be any node — anything can be a final goal, that is decided in your problem formulation (initial goal, final goal).

3.3.3 The Branching-Factor Problem

BFS has a real weakness. A branch factor is how many children a node has — in this example has two children. Suppose has 2000 children, and the goal is somewhere deep on the other side. BFS will first have to go through all 2000 children before it can even come to the next level. If the goal is somewhere beyond them, we waste a lot of time and memory in the full exploration of all the siblings of those nodes. That is one problem with BFS — a branch problem: high branch factor means slow progress toward depth.

Q: What if the goal is somewhere shallow but a node has many branches?

A: Exactly the difficulty: with a big branch factor you must traverse all those branches before reaching the next level, so you waste space and time when the goal is actually right behind them.

The cost of that caution is easy to see on a uniform tree where every node has children. The root generates nodes, each of those generates more, giving nodes at level 2, at level 3, and so on. If the solution sits at depth , the total number of nodes generated is

so both time and space complexity are . Those exponential bounds are the practical killer: with branch factor , a million nodes processed per second, and 1 KB of memory per node, a search to depth 10 takes less than 3 hours but needs about 10 terabytes of memory. BFS's memory demand is usually the bigger problem — it keeps every generated node until the search ends. This is the sense in which BFS "wastes space and time" when the goal is shallow but the branch factor is large.

3.3.4 Applications

Real-world: BFS is used for finding a path in a graph and for finding many solutions of a problem. There is a concept in graph theory called bipartition — a graph whose nodes split into two groups such that every edge runs between the groups — and BFS suits those problems too: color the start node red, its neighbors blue, their neighbors red, and a graph is bipartite exactly when this alternation never creates a conflict. The professor notes these two classic searches are fundamental; both are perfectly useful for particular applications and neither is "better" — they are suitable for different problems, which is more of a data-structures viewpoint.

When to use BFS — and when not. Use BFS when all step costs are equal and you want the fewest-actions solution (8-puzzle, word-ladder puzzles, finding the shortest path in an unweighted grid). Avoid it when step costs differ — BFS's "shallowest first" rule is then no longer "cheapest first", and uniform-cost search is the right tool. Also avoid it when the tree is wide: a high branching factor makes BFS sweep every sibling before making progress, wasting time and memory. And remember the classic BFS traps: it is complete and optimal only for uniform action costs, and its space requirement can exhaust memory long before time does.

Recap + bridge. BFS is the cautious level-by-level searcher: complete, optimal when all actions cost the same, but expensive in both time and space when the branching factor is high. That weakness — slow progress toward depth — is exactly what the next algorithm, depth-first search, attacks from the opposite direction.

3.4 Depth-First Search (DFS)

3.4.1 What DFS Does

Hook: BFS finishes a whole level before peeking at the next. What if the goal is deep — or the tree is so wide that sweeping a level is painful? Depth-first search takes the opposite bet: grab one path and plunge. It is the aggressive counterpart to BFS's caution.

Depth-first search (DFS) catches hold of one path and goes as deep as possible. When it realizes it cannot go any further, it comes back — backtracks — and tries another path. It maintains a stack (LIFO: last in, first out) to do this, instead of a queue. BFS was cautious: complete one level, then go to its children. DFS is the opposite: from a node, plunge immediately into the first child, then that child's first child, and so on until you hit a dead end.

Purpose. DFS answers "is there any path to the goal at all?" and, in many domains, finds one fast with very little memory. It is the tool of choice when the goal is likely to be deep and the state space is a tree — classic tree-like search without a reached-state table keeps only the current path in memory.

Inputs and outputs. Input: the problem's five components (a stack replaces the queue; path costs may be ignored entirely). Output: the first solution path DFS stumbles upon — there is no promise that it is the cheapest or the shallowest, only that it is some path to the goal.

The stack is what makes DFS what it is. The node added most recently sits on top, so the next expansion always dives into the newest frontier node — the deepest one — instead of the oldest, as a queue would. Since new children are pushed after their parent is expanded, the search immediately descends toward the leaves.

3.4.2 Worked Example — Deep Dive and Backtrack

Worked example: DFS on the same tree as BFS. Same tree: root with children ; has children , and has children . Goal , start .

The stack trace, step by step:

  1. Start: . Pop ; push its children (assume on top): .
  2. Pop ; push its children ( on top): .
  3. Pop . It has no children — a dead end. Stack: .
  4. Pop . Dead end. Stack: .
  5. Pop . This is the goal — stop.

The visited order is : plunge to , discover a dead end, backtrack to , dead end again, backtrack to — the goal. In words, from we go to ; from we immediately go to ; at we realize we cannot go any further, so we go to (the next unexplored child of ); then we move to ; from we go directly to ; from , knowing we cannot go anywhere, we go back to , then to . The contrast with BFS is very clear: in BFS, after we went to — we wanted to complete the level. In DFS, from we jump straight to the deepest reachable node.

Sense-check: with a stack, the frontier never holds more than one path's worth of siblings (one branch of the tree at a time), which is why DFS uses so little memory compared with BFS's full level of nodes.

The professor's second look at the same tree shows the aggressiveness even better: from we jump straight to , and from we jump to ; when we cannot go further from , we explore ; has no children — it is a leaf node — so we jump back to , and from we go to , then , and so on. We catch hold of something very deep and, as long as there is a path, we go there aggressively; when we can go no further, we stop and backtrack.

3.4.3 The Depth Problem

Suppose is the goal. When will DFS actually reach ? It will, eventually — but only after the deep dive. If also has a child , and has children, and so on — a structure called a skewed tree, with many children in one direction — DFS gets into a loop of going deeper and deeper, and the goal, which is off to the side, is missed for a long time. This is the opposite of BFS's problem: in BFS we explored sibling branches and wasted time; here it is not a branch problem, it is a depth problem. We keep going deep in one direction and only when we reach the leaf do we come back and eventually reach .

The memory benefit of DFS is real, though: a tree-like DFS without a reached table keeps only the current path, so space is , where is the branching factor and is the maximum depth of the tree. Problems that would need exabytes of memory under BFS can be handled with kilobytes under DFS. But the price is that DFS is not complete in general — in a cyclic state space it can loop forever (unless cycles are checked), and in an infinite state space it can wander down an infinite path. It is also not cost-optimal: it returns the first solution it finds, even if another path is far cheaper.

Neither algorithm is discarded: both have benefits. If the graph is small, nothing of this really matters — they are all the same on small inputs. And each has particular applications where it shines.

3.4.4 Applications

Real-world: DFS is intuitively better for connectedness questions. Suppose we want to know whether two people, call them X and Y, are friends in a social network graph. Catch hold of one of them and do DFS: go as deep as possible along one path — X → friend A (a dead end) — then backtrack and take another: X → friend B → friend C → Y. If we meet the other person's name anywhere along a path, they are connected; otherwise they are not. DFS answers this more simply than BFS. Similarly, topological sort in sorting techniques can be done with just DFS, and it will always give you the topological ordering — list tasks so that every task appears after all of its prerequisites. These are just two examples; a lot of things can be done with these two searches.

When to use DFS — and when not. Use DFS when memory is tight, when the goal is expected deep in the tree, or when any solution will do (connectedness checks, topological sort, and the maze-style problems discussed with iterative deepening). Avoid it when you need the shortest path, when the tree is skewed toward the wrong direction (the goal sits off to the side of a very deep branch), or when the state space has cycles — a naive DFS can circle forever inside a loop. The classic traps: DFS is neither complete (on infinite or cyclic spaces) nor cost-optimal (first-found is not cheapest).

Recap + bridge. DFS is the aggressive plunger: one path, as deep as possible, backtrack only at dead ends. It trades BFS's completeness and optimality for drastically smaller memory, and it pays for that with the depth problem — a skewed tree can hide the goal for a long time. Both weaknesses — BFS's branch problem and DFS's depth problem — are what the next two techniques, uniform-cost search and iterative deepening, are designed to fix.

3.5 Uniform Cost Search (UCS)

3.5.1 Definition and Rules

Hook: BFS finds the path with the fewest steps — but fewest steps is not cheapest. What if one road is long and slow and another is short? Uniform cost search answers that by replacing "shallowest" with "cheapest".

Uniform cost search (UCS) is also called cheapest first. It is essentially BFS, but with costs. Instead of expanding the shallowest node, UCS expands the node with the lowest path cost — the sum of edge costs from the start node to . Two rules matter:

  • Sort the frontier. Whenever we put something into the queue, we should immediately sort the queue. Otherwise we get misled: the node at the front of the queue might have a higher cost than something behind it. So we sort again and again, then pick the first element. The frontier is whatever is in the queue right now. We are not forced to use a priority queue — a normal queue that we sort works; a priority queue implemented with a min-heap would also always give you the minimum at the start, but any data structure is fine as long as the order is sorted.
  • Test the goal during expansion, not during generation. When we generate a new node (discover that it exists as a successor), we do not stop, even if it is the goal state. We only claim the goal when that node is expanded — pulled off the queue for exploration.

Purpose. UCS finds the lowest-total-cost path in a graph with arbitrary (positive) step costs. Where BFS spreads out in waves of uniform depth, UCS spreads out in waves of uniform path cost: it considers all paths systematically in order of increasing cost, never getting stuck down one path, and the first goal node it expands is guaranteed to be the cheapest one.

Inputs and outputs. Input: the five problem components with positive action costs . Output: the cost-optimal solution path — the first goal node popped off the frontier.

The evaluation function. Each node carries its path cost

— for the start node . UCS is best-first search with : always expand the node with the smallest .

The weights are actual, measured quantities: kilometers, miles, or fare — they come from real empirical data of the problem at hand, not from any estimate.

3.5.2 Worked Example — Romania

Worked example: UCS from Arad to Bucharest. Start: Arad. Goal: Bucharest. This is a simplified variant of the Romania map with the following road costs: Arad → Rimnicu Vilcea = 80, Arad → Fagaras = 99, Rimnicu Vilcea → Pitesti = 97, Pitesti → Bucharest = 101, Fagaras → Bucharest = 211.

  1. Queue is empty. Expand Arad: generate Rimnicu Vilcea (cost 80) and Fagaras (cost 99). Already sorted: .
  2. Expand the front: Rimnicu Vilcea (80). It can only take us to Pitesti: . Insert into the sorted queue: .
  3. Expand Fagaras (99). It can take us to Bucharest: . We know Bucharest is a goal state, but we do not test during generation — so Bucharest goes into the queue like any other node: .
  4. Expand Pitesti (177). It also takes us to Bucharest: . Queue: .
  5. Expand the front — Bucharest at 278. Now we are at the goal, so we stop.

The path found is Arad → Rimnicu Vilcea → Pitesti → Bucharest with total cost 278. Note what rule 2 just did: the search generated a Bucharest node at cost 310 while expanding Fagaras (step 3), but refused to stop there. If the goal test had run at generation, UCS would have returned the 310 path — suboptimal by 32. Waiting until expansion is exactly what guarantees the cheapest path.

Sense-check: every frontier node not yet expanded has cost at least 278 (the queue held ), so no hidden cheaper route to Bucharest can exist — the first expanded goal is optimal. We kept asking each node "where all can you take me, and at what cost?", inserting successors in sorted order of total cost, always removing the smallest, and waiting until we actually reached Bucharest by expansion — "when we reach the goal, we wait for the best path."

3.5.3 Student Questions

Q: Do we need a priority queue for this?

A: No. We are using a normal queue and sorting it after every insertion. A priority queue (a min-heap) is another way to always get the minimum at the start, but let's not go into heaps — the point is just that the queue stays in sorted order, whether you insert in order or sort each time.

Q: What are the weights — computational costs?

A: They are natural quantities: could be kilometers, could be the fare taken, and so on. They come from actual empirical measurement of the domain.

Q: If we remove the previous node from the queue, how does the search remember the path later?

A: Removing from the queue is not deleting the path. Wherever we have taken that path, we already store it and keep it; the final path and its cost are kept track of separately. Removal from the queue is only about what to explore next.

Q: Is the least cost always preferable?

A: Of course, depending on the problem — if you want to reach the goal at the lowest cost, this is preferable. But in some problems maximization is the goal: suppose the graph edges are money you gain — then you want to maximize. What the algorithm does stays the same: add the sum, put it in the queue, remove the lowest, explore it, and keep doing that until you are at a goal.

Q: What if the 211 edge were 150 instead?

A: You would keep exploring: add the sum, insert into the queue, remove whoever is lowest, explore them — the same logic, until you reach a goal. Whether the result is optimal is a separate question — that is not part of what we are checking here.

Q: There's a branch from Pitesti too — will it be considered?

A: Yes, whatever branches exist are expanded and their successors go into the queue. That is uniform cost search.

3.5.4 Where UCS Stands

At the end of the day UCS is nothing but BFS plus costing — the sorting on top. The known costs: memory usage is more, complexity is more, and so on. The worst-case time and space complexity is , where is the cost of the optimal solution and is the smallest step cost. When all step costs are equal, reduces to and UCS behaves like BFS. The exponent shows why UCS can be expensive: it will happily explore large trees of cheap actions before touching a single expensive-but-useful edge.

When to use UCS — and when not. Use UCS whenever step costs are not all equal and you need the cheapest path — its first expanded goal is guaranteed cost-optimal. Skip it when all costs are equal (BFS is faster and does the same job), and keep in mind the memory bill: like BFS, UCS keeps all reached nodes, so space is exponential in the solution cost. The classic trap is testing the goal at generation — doing so can return a suboptimal path, as the 310-vs-278 example shows.

Recap + bridge. UCS is BFS with a sorted frontier: expand the node with the smallest , test the goal only at expansion, and the first goal you expand is the cheapest. A connection to look ahead to: UCS and Dijkstra's algorithm are the same thing (single-source shortest path), while A* extends the idea further with a heuristic — . Meanwhile, BFS's branch problem and DFS's depth problem still exist for UCS's cousins, and the next technique attacks both at once.

Real-world connection: UCS is exactly what a "cheapest-first" planner needs when costs are real measured quantities — route planning by kilometers or miles, fare minimization, and any graph problem where the edges carry empirical prices rather than unit steps. Because it is Dijkstra's algorithm under an AI name, every industrial shortest-path problem (network routing, logistics, GPS precomputation) is a uniform-cost search in disguise.

3.8 Greedy Best-First Search (GBFS)

3.8.1 Definition

Hook: You now have a heuristic — an expert's guess about how close each node is to the goal. What happens if the search trusts that guess and nothing else? You get greedy best-first search: fast, focused, and often wrong about the price.

Greedy best-first search (GBFS) is an informed search technique that takes heuristics very seriously — it works only on the heuristics. Whatever heuristic value is given, that alone drives the search; the actual path costs are ignored completely. The evaluation function is simply the heuristic itself:

where is the evaluation used to pick the next node, and is the heuristic value — the estimated cost from node to the goal (not an actual measured value, just the estimate someone gave us). GBFS expands the node with the smallest .

Purpose. GBFS answers "which node looks closest to the goal?" — it expands the frontier node with the smallest , on the grounds that the node that appears closest is likely to lead to a solution quickly.

Inputs and outputs. Input: the graph plus a heuristic value for every node. If the heuristic data is not available, GBFS is not the tool — it is an informed search and cannot fall back to actual costs. Output: a path to the goal that is usually found quickly but is not guaranteed to be cheap.

Reading the heuristic table correctly matters: every value means "from node to the goal". Bucharest has because it is the goal — if you are already in Bucharest, it takes 0 kilometers to reach Bucharest. Arad's 366 means "if you are in Arad, it will take about 366 kilometers (or whatever metric) to go to Bucharest." These numbers come from a domain expert — someone who knows the whole region and its intuitions and hands you this data.

3.8.2 Worked Example — Romania

Worked example: GBFS from Arad to Bucharest. We are on the Romania map: start at Arad, goal at Bucharest. Actual road costs (which GBFS will not look at): Arad → Sibiu = 140, Sibiu → Fagaras = 99, Fagaras → Bucharest = 211. Heuristic values: , , , , , , .

  1. At Arad (366). Neighbors: Zerind (374), Timisoara (329), Sibiu (253). Smallest heuristic: Sibiu (253). Note we never write down the actual edge costs — the 253 is not the Arad-to-Sibiu cost.
  2. Expand Sibiu (253). Neighbors: Fagaras (176), Rimnicu Vilcea (253), Oradea (380), Arad (366). Smallest: Fagaras (176).
  3. Expand Fagaras (176). Neighbors: Sibiu (253) and Bucharest (0). Smallest: Bucharest — we have reached the goal.

Path found: Arad → Sibiu → Fagaras → Bucharest. What did the search actually spend? From the graph: Arad → Sibiu = 140, Sibiu → Fagaras = 99, Fagaras → Bucharest = 211, total

Sense-check: the heuristic had promised 253 from Sibiu — an underestimate of the real remaining cost (99 + 211 = 310). Because GBFS believed only the heuristic, it got carried away and did not find the optimal route, which runs through Rimnicu Vilcea and Pitesti at a total of 418. The route GBFS found is 32 units more expensive than the best route — greedy looked good and turned out costly.

3.8.3 Worked Example — Five-Node Graph

Worked example: GBFS on a five-node graph. A small graph with nodes 1 through 5; start is node 1, goal is node 5. The actual edge costs (minutes) are: 1 → 2 = 100, 1 → 3 = 100, 1 → 4 = 100, 2 → 3 = 50, 2 → 5 = 125, 3 → 5 = 125, 4 → 5 = 50. (These are the edges the walkthrough uses: node 1's neighbors are 2, 3, 4, and node 3's neighbors are 4 and 5 — so node 3 also connects to node 4. The updated edge values 1 → 2 = 70 and 1 → 3 = 125 belong to the A* variant later in the lecture.) The heuristic values: , , , , . A domain expert who knows this floor plan — your house, your office, the mall, the exam center — gives us: "from 1, if you want to go to 5, it will take 60 minutes; from 2, 120 minutes; and so on."

  1. Expand node 1: neighbors 2 (h = 120), 3 (h = 30), 4 (h = 40). Smallest: node 3.
  2. Expand node 3: neighbors 4 (h = 40) and 5 (h = 0). Smallest: node 5 — the goal. Stop.

Path: 1 → 3 → 5. The actual cost: 1 → 3 = 100, 3 → 5 = 125, total

About the numbers the professor asked to track:

  • Expanded nodes — we asked "where can you take me?" — were only 1 and 3; nodes 2 and 4 were generated but never expanded.
  • Generated nodes — every node ever put in the queue — count six in total: the start node 1, then 2, 3, 4 from node 1, then 4 and 5 from node 3 (node 4 is generated twice).
  • The max queue length at any point was three: initially just node 1; after expansion, 2, 3, 4; after expanding 3, nodes 4 and 5 remain.

Sense-check: the search stopped at the first goal node it reached — 1 → 3 → 5 at cost 225 — without ever expanding 2 or 4. Whether a cheaper route exists is irrelevant to GBFS: it never looks at the actual costs, so it cannot know.

3.8.4 Why GBFS Is Not Optimal

GBFS is not optimal. Two reasons are worth separating. First, it is greedy: a greedy algorithm takes what is best at the current moment without regard to future consequences. Greedy never promised the best possible way — it optimizes only for the current situation. Second — and this is the professor's deeper point — GBFS did not fully use the knowledge it had: the actual path costs were sitting right there in the problem, and it ignored them. It is the person who just believes others' advice and does not introspect: "You already know what is best for you. You're also taking advice. Why are you just believing on others' advices? Look at your data also. Think about yourself also."

Note the careful phrasing: GBFS did not take the wrong path — it took you to the goal — but its path cost was not optimal. In the five-node example it reached node 5 with cost 225, while the graph offers routes the search never priced: 1 → 2 → 5 = , 1 → 2 → 3 → 5 = , 1 → 3 → 5 (the route taken), and the routes through node 4 (1 → 3 → 4 → 5 and 1 → 2 → 3 → 4 → 5), each with its own cost. The lecture's point stands whichever route you price: the greedy search picked its path from the heuristic alone, so optimality was never even on the table.

In worst cases GBFS graph search is complete only on finite state spaces (on infinite spaces it can chase an ever-decreasing heuristic forever), and its worst-case time and space are — though with a good heuristic it typically explores far fewer nodes than that, in favorable cases dropping to .

3.8.5 Student Questions and Answers

Q: Arad to Sibiu is 253?

A: You have got this wrong — none of these values is a path cost between two cities. Arad's 366 means from Arad to Bucharest. And from Arad there are three ways: Sibiu, Timisoara, or Zerind — we did not write any path cost for those. The 253 says: if you go to Sibiu, Sibiu will take you in 253 units to Bucharest. All of these values are purely heuristics; GBFS relies only on these. Arad to Sibiu (the edge cost) was not considered at all. In short: heuristic values promise the remaining cost to the goal, never a path cost between two cities.

The same reading rule answers the next pair of questions about where heuristics come from and what happens to the start node's own value.

Q: Can the heuristic be considered a learned parameter of the machine?

A: You are on the right direction — this will not scale; you cannot have a domain expert in every place. There is a class of techniques called learning heuristics, where the heuristic itself learns from patterns, and it is part of this course (it has never been in the curriculum before this semester). We will spend a good amount of time on it next class. But so far, today, all of these values are human-given.

Q: Do we learn heuristics from experience? Is the heuristic updated on the fly?

A: Not in any of today's techniques. The heuristic is designed before the algorithm runs; you evaluate whether it is good or bad, and if it is promising you use it — it is not updated at runtime. Learning heuristics (where the algorithm itself creates its own heuristics) is exactly the next class's topic.

Q: Why wasn't the heuristic value calculated from the actual cost?

A: There are two things here. We are given two inputs: the actual cost and the estimates. If you use only the estimate, that is GBFS; if you use both, that is A*. Where itself comes from is a totally different question — a domain expert, your own experience, or a function model where you plug values in and get an answer. We will talk about how to create these s next class.

Q: What do we do with the value 60 at the start node?

A: Nothing, initially — we started at node 1 anyway. But if node 5 were not the goal, and some successor led back to node 1, then node 1 would be generated again, and at that point its heuristic (60) would matter for choosing whether to explore it.

Q: Is it mandatory to have heuristic values for all nodes? What if heuristic data is not available?

A: GBFS is an informed search — you need the heuristic values; considering actual cost instead is not an option in this technique. If the heuristic data is not available, GBFS is not the tool.

Now the questions that circle the real weakness — optimality — and what GBFS never looks at.

Q: If you add random exploration of neighbor nodes to the greedy move, will it be optimal?

A: Any greediness reduces the chance of optimality. To compensate, you add extra intuition — like exploring neighbor nodes and choosing the more promising one — and you can make it optimal. In general: if you know the exact problem, you can combine greedy with extra techniques and make it optimal for sure. But you cannot come up with an algorithm that is optimal for all use cases — that is the territory of NP-complete and NP-hard problems. If you tone the problem down to a well-understood case, you can target an exactly optimal algorithm — but you have solved a reduced set, not the generalized version.

Q: Suppose the cost of one step is minimum, but after following that path the other path costs are very large — won't this be infeasible?

A: That is exactly what we mean — we never claimed optimality is always best; the heuristic is guiding you, and guidance can sometimes mislead. This is why A* exists: it considers the actual cost along with the heuristic and is more cautious, so we do not end up in the situation you describe.

Q: What is the actual total cost of the Arad → Sibiu → Fagaras → Bucharest route? Is it 253 from Sibiu?

A: 253 is just the estimate. For the actual cost, go back to the graph: Arad to Sibiu is 140, Sibiu to Fagaras is 99, Fagaras to Bucharest is 211 — . Sibiu told us it would take us to Bucharest in 253, but did it really? The actual path costs alone are 99 plus 211 — over 300. We got carried away because we only believed its word. Domain expertise is a must, and pure supervision does not work here — which is why learning heuristics are coming.

Q: Why is GBFS not great? It reached the goal.

A: It reached the goal — it did not take you to the wrong place; the path cost was not optimal. The fundamental problem is that it did not fully use the knowledge it had. It only believed the heuristic and never looked at the actual costs sitting in the problem. He is that person who just believes on others' advices and not introspecting — you know what is best for you, so use your own data too.

Two questions connect GBFS to its cousins — Dijkstra's algorithm and the informed family.

Q: Is UCS the same as Dijkstra's? And A* versus Dijkstra?

A: UCS and Dijkstra's are the same — single-source shortest path. A* follows the same algorithmic intuition, but with a twist: what A* adds is a heuristic, whereas in Dijkstra what you add is the actual cost you see in the graph (how far have I come). Dijkstra is not an informed algorithm — it has no extra information like a heuristic. The right statement: UCS and Dijkstra are the same; A* is the informed variant.

Q: Does Google Maps use this?

A: Google Maps is a very, very advanced algorithm because of the environment — think back to the environment types from the last class. In the real world where Google Maps operates, what is the environment? Fully observable? Stochastic? Episodic, sequential, dynamic — it is dynamic. Suddenly there is an accident, someone reports it, and the route changes. Users suggest things: "there is a roadblock here" — all of that is taken into consideration. Those are heuristics again, updated live. So Google Maps uses sophisticated things, but it all boils down to some of these fundamentals. In other words: Google Maps layers live heuristics over a dynamic environment — it is not plain A* running on a static graph.

And the vocabulary question that trips up many students — it matters for exam traces.

Q: What do "expanded" and "generated" mean?

A: Expanding a node means actually asking the question "where all can he take me?" — when we were at the root node we asked it and learned we can go to 2, 3, or 4. The new nodes produced by that question are the generated nodes, and they go into the queue. In the five-node example only 1 and 3 were expanded — we never asked node 2 or node 4 where they could take us. Node 5 was not expanded because it is the goal; we reached it and stopped.

Exam note: a probable question pattern is: given a graph, actual costs, heuristic values, start and goal, trace GBFS — state which nodes were expanded, which were generated, the queue behavior (max queue length), the path found, and its actual cost. The value of the start node's own heuristic is not used unless the search returns to it.

Recap + bridge. GBFS trusts the heuristic alone: , expand the smallest. It reaches the goal fast, but ignores the actual costs it has, so the path can be expensive — the person who believes every piece of advice and never introspects. The fix is to use both inputs — and that is precisely what A* does next: .

3.10 Admissibility and Consistency

3.10.1 Admissibility

Hook: A* is optimal — but only under conditions. A star is a careful searcher, yet its carefulness is only as good as the heuristic that steers it. The two conditions that decide optimality are admissibility and consistency, and both are simple inequalities you can check by hand on every node.

A* is optimal when the heuristic satisfies two conditions: admissibility and consistency.

A heuristic is admissible if it never overestimates the actual cost to reach the goal:

where is the heuristic value you were given (as in all the problems so far), and is the true cost from node to the goal — the real, actual cost found in the graph. Students sometimes want to put here; that is wrong. is the cost taken from the initial node to arrive at node . is from node to the goal — a different quantity entirely.

Worked example: admissibility check on Pitesti. At the step where the current node is Pitesti, (Arad → Sibiu → Rimnicu Vilcea → Pitesti: 140 + 80 + 97). The true cost is the actual Pitesti → Bucharest road cost, which is 101. Our heuristic said .

Check the condition: is

Yes — 100 is less than 101, so this heuristic is admissible; it did not overestimate. The heuristic may underestimate the cost — it is optimistic — but it must never exaggerate it.

Sense-check: a heuristic that said 200 would fail the check (200 > 101), and A* could then reject the real cheapest route as "too expensive", breaking optimality. The Pitesti value of 100 is on the safe side: close to the truth and still below it.

Real-world: straight-line distance is admissible for route planning, because the actual road cost between two places cannot be shorter than the straight-line distance between them. No road is a perfectly straight line — they all bend, so the true driving distance is at least the bird's-eye distance. That makes straight-line distance a natural admissible heuristic for maps.

3.10.2 Consistency

How close the heuristic is to the true value matters, and that is what the second condition, consistency (also called monotonicity), captures. A heuristic is consistent if, for every node and every successor of :

where is the actual cost of the step from to , and , are the heuristic values of the two nodes. The plain-language meaning: the estimated cost should not suddenly drop by more than the actual step cost. As we move towards the goal, the heuristic should reduce gradually — the estimate decreases along the path, but no faster than the real step cost justifies.

Why the inequality is a triangle inequality. Picture a triangle with vertices , , and the goal. The direct edge from to the goal is one side — its length is bounded below by the estimate . The path is the other two sides — cost plus the estimate . Consistency says a side of a triangle cannot be longer than the sum of the other two sides: the direct estimate cannot exceed the roundabout route . Straight-line distance satisfies this on any map, because a straight line is always shorter than any broken line — so the straight-line heuristic is consistent as well as admissible. Every consistent heuristic is admissible, but not every admissible heuristic is consistent.

Example of the intuition: and — the estimate is close to the truth. A value of 10 would also satisfy admissibility (10 < 101, no overestimate), but 10 is not close to the actual 101 — a weak guide. Closeness is what distinguishes a good heuristic from a merely admissible one.

3.10.3 Why Consistency Matters

If a heuristic is consistent, -values do not decrease along the path. This means: once A* expands a node, the best path to that node has already been formed — there is no danger that a later, cheaper route to the same node appears. If this property is not satisfied, "we will go for a toss": the search can re-find nodes more cheaply, and the optimality guarantee breaks down. Both conditions — admissibility and consistency — must hold for all nodes; then A* is optimal and you will definitely get the correct answer. Otherwise A* is not optimal.

The reasoning in one breath: moving from to changes from to . The cancels, and the -value is non-decreasing exactly when — which is precisely consistency. So with a consistent heuristic, A* expands nodes in order of non-decreasing ; the first time it pops a node, that node has already been reached by its cheapest possible path, and the first goal popped is the cheapest goal.

3.10.4 Student Questions

Q: Is the same as ?

A: No — and students often make this mistake. is the cost that took us from the initial node to node . is the actual, true cost from node to the goal — you read it off the graph, from forward. In the Pitesti step: (what we already spent), while (the remaining road cost to Bucharest). The heuristic , so it is admissible.

Q: Underestimation is fine — could the heuristic be 50, or even 10? That could change the route.

A: Yes, 10 is also admissible — it is less than the true cost, it satisfies the condition, and it could indeed change the route that A* picks. But admissibility alone is only the first condition. The question "how close is 10 to the actual 101?" is answered by the second condition, consistency. 100 is close to 101; 10 is not.

Q: So if the heuristic is not close to the actual, the search is messed up?

A: Exactly — that is why evaluating good versus bad heuristics is our job. But given a reasonable heuristic, A* does the job, and you should be able to trace it.

Q: Why does consistency matter so much — what does it buy us?

A: If a heuristic is consistent, -values never decrease along the path. That means once A* expands a node, the best path to that node has already been formed — no later, cheaper route to the same node can show up and force a redo. If consistency fails, the search can re-find nodes more cheaply, and the optimality guarantee breaks down — we will go for a toss.

3.10.5 Exercises for the Next Class

Two exercises were set. First, planning and problem formulation — three problems, and for each you should formulate the five components (initial state, goal state, actions, transitions, path cost) and, as extra practice, do the PEAS and environment definition as well: planning a trip with a delivery drone; solving a maze; scheduling patient appointments in a clinic. Second, an A* trace: a graph is given with data — the start, the goal, actual costs, and heuristic values , , and so on — run A* on it and report the search. A third task will be done together next class: for each node of a given graph (with node 3 as the goal), check whether the given heuristic is admissible, and then check consistency — the class already agrees on the admissibility answers, and the consistency check via the formula will be worked through together.

Exam note: expect to be asked whether a given heuristic is admissible and/or consistent, and to explain what each condition guarantees about A*'s optimality. The two inequalities are the whole check: per node for admissibility; for every edge for consistency.

Recap + bridge. Admissibility keeps the heuristic optimistic (); consistency keeps it from dropping too fast (). Together they make -values non-decreasing, so the first goal A* expands is the cheapest — that is when A* is optimal. This closes the lecture's arc: from the five-component formulation, through the uninformed family, to heuristics, GBFS, A*, and the conditions that make A* trustworthy. Next class turns to the heuristics themselves — how they are created, and how they can be learned.

Exam Guidance Summary

  • Mid-semester exam talk: the professor will discuss the mid-sem exam in the 8th class and will upload a sample paper then; the same happens before the final exam. The ACI exam usually falls in the second week of the exam schedule, so there is preparation time after the discussion.
  • Sample papers: the course has changed a lot — many topics were removed and new ones added — so some past papers may not be relevant. The advice is explicit: do not get bogged down by sample papers and exam preparation; there is no correlation between solving past papers and performing better, and it can do more harm than good. Attend all classes, explore the topics, and you will fare well; the quiz, the assignments, and the final exam are other avenues.
  • Probable question types so far (learning outcomes):
  • PEAS specification for a given situation; judging an environment (e.g., chess) across its different aspects.
  • Choosing the best-suited agent architecture (reflex vs goal-based vs utility-based, etc.).
  • Formulating a problem with the five definitions: initial state, actions, transition, goal, path cost.
  • Tracing uninformed searches — BFS, DFS, UCS, iterative deepening — and knowing the intuition for when each fits (e.g., maze → DFS; unknown depth, large tree → iterative deepening). The animations are not exam questions, but they form the basis of the techniques.
  • Tracing GBFS given a graph, heuristic values, start and goal: expanded nodes, generated nodes, queue behavior (max queue length), the path, and its actual cost.
  • Tracing A* given the graph, , , source, and goal: produce the state-space trace, the path, and the cost. When multiple shortest paths tie, use lexicographical (alphabetical) ordering in exams.
  • Admissibility and consistency of a heuristic, and what they guarantee about A* optimality: for admissibility; for consistency, checked per node and per edge.
  • Study resources: the uninformed-search animations (play with your own inputs); the data-structures material on the course page, only if you lack a CS background (queues, stacks); the lab activity where BFS and DFS are implemented — the recording and the Python program are available if you want to see the algorithms in code.

Key Industry Applications

  • BFS: finding a path in a graph, finding many solutions, and graph-theory problems such as bipartition — checking whether a network can be split into two groups with no edges inside a group, useful in scheduling and matching problems.
  • DFS: quickly checking connectedness in a graph — e.g., are two people connected in a social network (walk from one, go deep, backtrack until you either meet the other person or exhaust the paths) — and topological sort, which DFS always produces in the correct ordering, a staple of build systems and task scheduling (a task is listed only after its prerequisites).
  • UCS: cheapest-first route planning with real measured costs — kilometers, miles, or fares from actual empirical data. Under its other name, Dijkstra's algorithm, it is the workhorse of network routing: computer networks, logistics, and shortest-path services all run uniform-cost ideas at scale.
  • A*: pathfinding and graph traversal in a lot of games and web-based maps; it finds the shortest path efficiently by balancing cost so far with the heuristic. Video-game enemy AI, GPS navigation, and robotics motion planning are the classic A* consumers.
  • Google Maps (with a warning): it does not use just A* — it is far more advanced because its environment is dynamic: accidents get reported, routes change, users report roadblocks, and those inputs act as heuristics that are updated live. It uses sophisticated machinery, but it all boils down to these fundamentals.
  • Heuristics in practice: domain experts supply the estimates (like a city guide's travel-time estimate); heuristics must be evaluated (admissibility, consistency) before use; and the frontier of practice is learning heuristics — algorithms that learn their own heuristics from patterns, covered later in the course.

ACI Lecture 3 notes · Uninformed and Informed Search

Artificial Computational Intelligence· postgraduate· 2026-08-13

Sections Breakdown

1Search Problem Formulation Recap

The five components of a search problem, worked formulations (road trip, 8-puzzle), and the probable question types.

2Uninformed versus Informed Search

The two families of search, the comparison table, and why informed search uses a heuristic.

3Breadth-First Search (BFS)

Level-by-level search with a FIFO queue, a queue trace, the branching-factor problem, and applications.

4Depth-First Search (DFS)

Deep-dive search with a stack, backtracking, the depth problem, and applications.

5Uniform Cost Search (UCS)

Cheapest-first search, the sorted-frontier rules, the Romania worked example, and complexity.

6Iterative Deepening Search

Depth-limited DFS with growing limits, iterative lengthening, and choosing a search algorithm.

7Heuristic Functions and Informed Search

What a heuristic is, the guiding-light analogy, good versus bad heuristics, and where they come from.

8Greedy Best-First Search (GBFS)

Search driven only by the heuristic, two worked examples, and why GBFS is not optimal.

9A* Search

The evaluation function f(n) = g(n) + h(n), worked traces on a five-node graph and Romania, and exam trace rules.

10Admissibility and Consistency

The two optimality conditions for A*, their triangle-inequality intuition, and the next-class exercises.

11Exam Guidance Summary

The professor's exam talk, sample-paper advice, probable question types, and study resources.

12Key Industry Applications

Where each search technique is used: bipartition, connectedness, topological sort, routing, games, and Google Maps.

Postgraduate students in Artificial Computational Intelligence

Exam Revision Notes

Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.

Search Problem Formulation Recap

Must-know: Whatever problem is given, you must be able to write the five components: initial state, goal test, possible actions, transition model, and path cost; plus PEAS and environment judgement for a situation.

⚠️ Top pitfall: Confusing the goal test (a yes/no check) with the goal state (a specific destination), and forgetting that path costs are assumed positive and additive.

Self-check: For the 8-puzzle, what are the five components of the formulation?

Connects to: 3.2.

Uninformed versus Informed Search

Must-know: Uninformed search uses only the given problem; informed search adds a heuristic from a domain expert. Completeness is per-algorithm, not per-family.

⚠️ Top pitfall: Calling uninformed search random — it is systematic (queue for BFS, stack for DFS) but information-poor.

Self-check: Why is informed search usually more efficient than uninformed search?

Connects to: 3.7.

Breadth-First Search (BFS)

Must-know: BFS covers one level at a time with a FIFO queue; high branch factor means slow progress toward depth and wasted space/time.

⚠️ Top pitfall: Forgetting that BFS is optimal only when all action costs are equal; with differing costs, shallowest is not cheapest.

Self-check: Why does a node with 2000 children hurt BFS even when the goal is shallow?

Connects to: 3.4, 3.5.

Depth-First Search (DFS)

Must-know: DFS goes as deep as possible with a stack and backtracks at dead ends; its weakness is the depth problem (skewed trees), not the branch problem.

⚠️ Top pitfall: Expecting DFS to be complete or cost-optimal; it returns the first solution found and can loop forever on cyclic spaces.

Self-check: Why does DFS use far less memory than BFS?

Connects to: 3.3, 3.6.

Uniform Cost Search (UCS)

Must-know: UCS expands the node with the lowest g(n), keeps the frontier sorted, and only claims the goal at expansion; the first expanded goal is optimal.

⚠️ Top pitfall: Testing the goal during generation instead of expansion — this returns the suboptimal 310 route instead of the optimal 278 route.

Self-check: In the Romania example, why did UCS ignore Bucharest when Fagaras generated it at cost 310?

Connects to: 3.3, 3.8, 3.9.

Iterative Deepening Search

Must-know: IDS applies DFS iteratively with growing depth limits, avoiding DFS's deep-loop worst case while keeping memory small; iterative lengthening fixes BFS's wide-branch problem.

⚠️ Top pitfall: Thinking every iteration restarts from the root; in practice the search continues from the frontier of the previous iteration.

Self-check: Why does IDS use about the same time as BFS but far less memory?

Connects to: 3.3, 3.4.

Heuristic Functions and Informed Search

Must-know: A heuristic is a deterministic estimate of the remaining cost to the goal; it guides the search but never guarantees the best solution, and it must be evaluated (admissibility, consistency) before use.

⚠️ Top pitfall: Treating the heuristic as a promise or as a probability — it is an intuition that can be good or bad.

Self-check: Why is a city guide's travel estimate a good analogy for a heuristic?

Connects to: 3.2, 3.8, 3.10.

Greedy Best-First Search (GBFS)

Must-know: GBFS expands the node with the smallest h(n), uses no actual costs, is fast but not optimal; traces must report expanded nodes, generated nodes, max queue length, path, and actual cost.

⚠️ Top pitfall: Misreading heuristic values as path costs between cities — 253 is Sibiu-to-Bucharest estimate, not the Arad-to-Sibiu road cost; also confusing expanded (asked where it can go) with generated (new successors added to queue).

Self-check: Why did GBFS return 1-3-5 at 225 without expanding nodes 2 and 4?

Connects to: 3.5, 3.9.

A* Search

Must-know: A* expands the node with smallest f(n) = g(n) + h(n); never carry a previous node's f forward; compare all leaf nodes in the queue; the first goal expanded is optimal when the heuristic is admissible and consistent.

⚠️ Top pitfall: Carrying the previous node's f-value forward (140 into f(5)) and expanding a new node without comparing all leaves (Pitesti 417 before Fagaras 415).

Self-check: In the Romania trace, why is Fagaras (415) expanded before Pitesti (417)?

Connects to: 3.5, 3.8, 3.10.

Admissibility and Consistency

Must-know: Admissibility: h(n) <= h*(n) per node — the heuristic never overestimates. Consistency: h(n) <= c(n,n') + h(n') per edge — f-values never decrease, so the first goal expanded is optimal.

⚠️ Top pitfall: Putting g(n) in place of h*(n) — g(n) is the cost already spent from the start; h*(n) is the true remaining cost to the goal.

Self-check: Why is h(Pitesti) = 100 admissible when the true Pitesti-to-Bucharest cost is 101?

Connects to: 3.9.

Exam Guidance Summary

Must-know: The examinable skills are: PEAS + environment judgement, agent architecture choice, five-component formulation, uninformed-search traces and intuitions, GBFS traces, A* traces with lexicographical tie-breaking, and admissibility/consistency checks.

⚠️ Top pitfall: Over-studying sample papers — the professor states there is no correlation and it can do more harm than good.

Self-check: What convention should be used when multiple A* paths tie?

Connects to: 3.1, 3.8, 3.9, 3.10.

Key Industry Applications

Must-know: Each search technique maps to a named application: BFS-bipartition, DFS-connectedness/topological sort, UCS-cheapest routing (Dijkstra), A*-games and maps, Google Maps-live heuristics over a dynamic environment.

⚠️ Top pitfall: Claiming Google Maps is simply A* — it layers live user-report heuristics over a dynamic environment.

Self-check: Which search is best for checking whether two people are connected in a social network, and why?

Connects to: 3.3, 3.4, 3.5, 3.9.

Was this lecture useful?

Loading comments…
🤖

BitsNotes AI Assistant

Subject Notes Assistant

Configure AI Chat

Choose how to access the chatbot
Have your own API key?

Switch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.

🔑 Enter API key above to fetch live models from provider, or enter model name manually.
OpenAI-Compatible API Support

Choose any provider preset (Gemini, DeepSeek, Kimi, GLM, MiniMax, Qwen, OpenAI, Groq, Ollama, etc.) or enter a custom endpoint URL.

Security & Privacy First

Your API key is sent directly from your browser to your specified provider. BitsNotes servers never store or see your key.