🏗️ ΘρϵηΠατπ🚧 (under construction)

A heuristic is an idea that helps you make a decision, any heuristic might not actually help you get to your goal, that's why it's a heurisitc and not a method or a prodcedure.

Our goal is to develop a domain specfic heuristic function h(n) which guesses the cost of getting to a goal state froma node n, where if we see h(n1)<h(n2) then we would guess that it is cheap to get to a goal node from n1 then from n2. If g is a goal state then we define h(g)=0

The heuristic is defined on the state stored in the node, so that if two different nodes have the same state then their heuristic values would be the same.

Greedy Best First

Use a frontier which has a priority queue, where a nodes priority is it's h value. Therefore we will always expand nodes by lowest h value to attempt to greedily find a low cost solution. Since h values don't necessarily have to depend on the cost of a path, then in general it will not produce cost optimal solutions.

f value

One way of trying to fix the above issue with costs, is to incorporate the cost of a given path as we continue. Let's define the following function:

f(n)=g(n)+h(n)

Where g(n) is the cost of the path to n and h(n) is our usual heuristic, let's denote f as a evaluation function, and it's individual values f(n) as f values, it's purpose is to estimate the cost of getting to the goal from n

The purpose of the f-value is to combine our knowledge about the cost of a nodes path and what the heuristic value returns.

A Star

In A* we will define a f-value function, and expand the node with the lowest f-value on the frontier

We'll note that if there is no solution in the graph, and the graph is an infinite number of different states (even with finite branching factor) which are reachable from the initial state, then this algorithm will never terminate.

This is because on every iteration we will be adding more nodes to the frontier, and we only consume one node off the frontier at a time so we will never be able to clear them all, we note that the algorithm only terminates once the frontier is empty.

But if there ar ea finite number of different reachable states and we do path checking or cycle checking, then it will eventually terminate and deduce that there is no solution. If we don't do cycle checking then it would constantly add a node to the fronteir pop it off and add the next node in the cycle, and continue doing that forever.

A* Execution Table
For the following graph where A is the start node and D is the goal:
Run A* with and without cycle checking, drawing the frontier table for each.

Complete

We can prove that A* is complete under certain conditions.

A* is Complete
A* will always find a solution if one exists so long as
  • There exists a maximum branching factor
  • There exists a global lower bound ϵR>0 for all actions
  • h(n) is finite for every node n which can be extended to reach a goal node

Note that the reason we require a global lower bound on our actions, is that suppose there was a sequence of actions with costs 12,14,18,, and suppose we have some constant heurstic such that h(n)=1 for all nodes, then we note that 1+12k2 and so if every other value in the frontier is greater or equal to 2, then we would continue selecting nodes with these geometric costs, and if there is no goal node then it would do this forever.

We require that the h value is finite, if it can be extended to reach a goal node because if it were infinite, then it's f value would also be infinite, and thus it is greater than all other values, and therefore anything in the frontier will always be expanded before it gets expanded, and the only way it would be expanded is if nothing else is on the frontier, but that's never guarenteed to happen since our graph may be infinite.

Admissible Heuristic
Let min_cost_to_reach_goal(n) be the cost of an optimal path from some node n to a goal node (define as inf otherwise), then a heurstic function h is said to be admissible if h(n)min_cost_to_reach_goal(n)
A* is Not Cost Optimal if The Heuristic is Not Admissible
Show that A* returns a non cost optimal path if the heuristic is not admissible

This requires that your heustic estimate is less than or equal to the cost of an optimal path to the goal node, that is to say that your heuristic never over-estimates, it can only under-estmiate the cost of getting to the goal node. This implies that the search won't miss any promising path if it is cheap to get to a goal via n ( that is to say that g(n) is low and C(n) is low), then f(n) is also low, and eventually n will be expanded off the frontier.

A* Never Expands Large f-values
A* with an admissible heuristic never expands a node with f-value greater than the cost of an optimal solution
A* is Optimal
If the following assumptions hold true, then A* will find an optimal cost solution:
  • the branching factor is finite
  • there is a global lower bound on all actions given by ϵR>0
  • our heuristic h is admissible
Monotone Heuristics
We say that a heuristic function h is monotone if it satisfies the triangle inequality, that is for all nodes x,y such that y is a successor of x and a is the action between them: h(x)C(x,a,y)+h(y) Where C(x,a,y) denotes the cost of getting from the state of x to y via action a

This means that h(x) has to be less than the estimate of h(y) plus the cost of actually moving from x to y. So for example if we know that h(x)=100, and the cost of moving from x to y is 10, then h(y) is at least 90.

It says that "we don't change our mind", based on a simple transition, so that by taking one action our heuristic isn't going to drastically change.

Monontonicity implies Admissibility
Later Expansions Imply Larger f-values Under Monotonic Heuristic
If a node y is expanded after x by A* with a monotonic heuristic, then we know that f(x)f(y)
First Expansion is Minimum Cost Uner Monotonic Heuristic
With a monotone heuristic, the firs ttime A* expands a node n, n must be a minmum cost solution to n.state