AI MID Answers
AI MID Answers
Uniform-cost search is an uninformed search algorithm that uses the lowest cumulative cost
to find a path from the source to the destination. Nodes are expanded, starting from the
root, according to the minimum cumulative cost. The uniform-cost search is then
implemented using a Priority Queue.
Algorithm for uniform cost search:
• Insert the root node into the priority queue
• Repeat while the queue is not empty:
Remove the element with the highest priority
If the removed node is the destination, print total cost and stop the algorithm
Else, enqueue all the children of the current node to the priority queue, with their
cumulative cost from the root as priority.
2. What is meant by imperfect real time decisions?
Imperfect real-time decisions
Because moves must be made in a reasonable amount of time, usually it is not feasible to
consider the whole game tree (even with alpha-beta), so programs should cut the search off
at some point earlier and apply a heuristic evaluation function to states in the search,
effectively turning nonterminal nodes into terminal leaves.
i.e., Alter minimax or alpha-beta in 2 ways:
1) replace the utility function by a heuristic evaluation function EVAL, which estimates the
position’s utility.
2) replace the terminal test by a cut-off test that decides when to apply EVAL.
Evaluation function
An evaluation function returns an estimate of the expected utility of the game from a given
position.
The picture depicts A CSP over finite domains. We have a set of variables — X, a set of list of
domains — D, and a set of constraints — C.
Values assigned to variables in X must be one of their domain
A constraint restricts the possible values of a subset of variables from X.
Example
A good example is Map Coloring Problem. In that problem we have the variables which are
the regions, the domains are the colors that we can assign to the variables (red, green,
yellow, blue); in this example all variables have the same domains.
Encoding Planning Problems into CSPs
Just like with the “Planning as Satisfiability” in which we encode the Planning Problem into
the Propositional Satisfiability Problem, we can do the same with this approach.
We encode the Bounded Planning Problem — restricted Planning Problem with a fixed
length of plan into a Constraint Satisfaction Problem. There are four steps to fully encode it.
We will see them one-by-one below.
CSP Variables and Domains
In this first step, we want to create CSP Variables and their corresponding CSP Domains.
There are two components that we need to convert into CSP Variables, they are:
* Predicates
* Actions
For predicates, we instantiate all predicates for each step. Remember that we have a fixed
length of plan (k).
Variables x, y, z, a, b,....
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃