












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Important Points: (^) All the previous search control strategies [BFS and DFS] have been blind searches (^) They make no use of any knowledge of the problem (^) If we know something more about the problem, we can usually do much, much better Example: 15-puzzle For each piece/position, figure out how many moves away it is from its goal position , if no other piece were in the way The total of these gives a measure of distance from goal
A heuristic is a rule of thumb for deciding which path choice might be the best There is no general theory for finding heuristics, because every problem is different Choice of heuristics depends on knowledge of the problem space Many traditional search algorithms are used in AI applications. For complex problems, the 'traditional algorithms' are unable to find the solution within some practical time and space limits. Consequently, many special techniques are developed, using heuristic functions. The algorithms that use heuristic functions are called heuristic algorithms.
Heuristic algorithms are not really intelligent ; they appear to be intelligent because they achieve better performance. Heuristic algorithms are more efficient because they take advantage of feedback from the data to direct the search path. (^) Uninformed search algorithms or Brute-force algorithms search,
through the search space, all possible candidates for the solution checking whether each candidate satisfies the problem's statement. Informed search algorithms use heuristic functions, that are specific to the problem, apply them to guide the search through the search space to try to reduce the amount of time spent in searching.
A good heuristic can make an informed search dramatically out-perform any uninformed search.
For example, the Traveling Salesman Problem (TSP) where the goal is to find a good solution instead of
finding the best solution.
In TPS like problems, the search proceeds using current information about the problem to predict
which path is closer to the goal and follow it, although it does not always guarantee to find the best
possible solution. Such techniques help in finding a solution within reasonable time and space.
Some prominent intelligent search algorithms are stated below.
This is a ' heuristic measure'
Informed Search
User heuristics h(n)
Search Algorithms G (State, Operator, Cost)
Uninformed Search
Generate -and- test
Hill Climbing
Best first search
Problem Reduction
Constraint satisfaction
Mean-end- analysis
Hierarchical^ Representation^ of Search Algorithms A representation of most search algorithms is illustrated below. It begins with two types of search - Uninformed and Informed.
Uninformed Search :^ Also called^ blind, exhaustive or brute-force^ search, uses no information about the problem to guide the search and therefore may not be very efficient.
Informed Search :^ Also called^ heuristic^ or^ intelligent^ search, uses information about the problem to guide the search, usually guesses the distance to a goal state and therefore efficient, but the search may not be always possible.
No heuristics
Priority Queue: h
Priority Queue: f(n)=h(n)+g(n)
Fig 4.1. Different Search Algorithms
A* Search
AO* Search
Arrange four 6-sided cubes in a row, with each side of each cube painted one of four colours, such that on all four sides of the row one block face of each colour is showing.”
Hill Climbing Hill climbing is a variant of generate-and-test in which feedback from the test procedure is used to help the generator decide which direction to move in the search space. Searching for a goal state = Climbing to the top of a hill Hill climbing = Generate-and-Test + Direction to move.
Heuristic function to estimate how close a given state is to a goal state.
1: Evaluate the initial state. If it is also a goal state, then return it and quit. Otherwise, continue with the initial state as the current state. 2: Loop (repeat) until a solution is found or until there are no new operators left to be applied in the current state : (a) Select an operator that has not yet been applied to the current state and apply it to produce a new state. (b) Evaluate the new state. (i) If it is a goal state, then return it and quit. (ii) If it is not a goal state but it is better than the current state, then make it the current state. (iii) If it is not better than the current state, then continue in the loop.
The key difference between this algorithm and the one we gave for generate-and-Test is the use of an evaluation function as a way to inject task·specific knowledge into the control process.
Problems/Limitations of Hill Climbing
How to apply Best-First-Search to nodes/tree to digging out the solution (goal node):
**- Two lists are to be maintained: CLOSED & OPEN
Numbers by the nodes are regarded as estimates of the distance or cost to reach the goal node
Best-First-Search
Let's start from S (Starting-node) and go to G (Goal-node)
Note: Always take the heuristic value of pointing child)
An example of A algorithm:*
Here graph-nodes are given along with the pre-defined heuristic values; and we have to find out the shortest (minimum cost) path while traversing this graph. h(n) i.e., the heuristic function is provided in the table; g(n) is provided along with the directed paths.
SELECTION OF AVAILABLE PATHS:
Comparison among the Informed ~ Uninformed Algorithms
Brute force / Blind search (^) Heuristic search
◊ (^) Only have knowledge
about already
explored nodes
◊ (^) No knowledge about
how far a node is from
goal state
◊ (^) Estimates “distance” to goal state
◊ Guides search process toward goal state
◊ (^) Prefers states (nodes)
that lead close to and not
away from goal state
◊ Heuristics, are knowledge about domain which helps searching and reasoning in its domain.
◊ Heuristic search incorporates domain knowledge to improve efficiency over blind search methodologies.
◊ Heuristic is a function that when applied to a state, returns a value as estimated merit of state, with respect to goal.
◊ Heuristic search function estimates cost from current state to goal, presuming function is efficient.
Heuristic Control Strategies
Search for a solution in a problem space, requires "Control Strategies " to control the search processes. The search control strategies are of different types, and are realized by some specific type of "Control Structures".
- Strategies for search Some widely used control strategies for search are stated below.
◊ Forward search:^ Here, the control strategies for exploring search proceeds forward from initial state towards a solution; The methods are called data-directed.
◊ Backward search:^ Here, the control strategies for exploring search proceeds backward from a goal or final state towards either a solvable sub problem or the initial state; the methods are called goal-directed.
◊ (^) Both forward and backward search : Here, the control strategies for exploring search is a mixture of both forward and backward strategies.
◊ Systematic search:^ Where search space is small, a systematic (but blind) method can be used to explore the whole search space. One such search method is Depth-First Search and the other is Breath-First Search.
The drawback of local search techniques is that they can get “stuck” in: Local maxima:^ The algorithm only finds the first solution that is locally available. This may not be the best overall solution. Plateaux: If a neighboring value is equal to the current value, the algorithm will not explore that direction, even if better values lie just beyond it.
Constraints arise in most areas of human endeavor. Constraints are a natural medium for people to express problems in many fields. Many real problems in AI can be modeled as Constraint Satisfaction Problems (CSPs) and are solved through search.
◊ (^) Constraint is a logical relation among variables.
The constraints relate objects without precisely specifying their positions; moving any one, the relation is still maintained. (^) For instance; “A circle is inside the square”.
The Constrain t Satisfaction is a process of finding a solution to a set of constraints. The constraints articulate allowed values for variables and finding solution is the evaluation of these variables that satisfies all constraints.
◊ (^) Constraint Satisfaction Problems (CSPs)
The CSPs are all around us while managing work, home life, budgeting expenses and so on;
(^) We need to find solution to such problems satisfying all constraints.
(^) The Constraint Satisfaction Problems (CSPs) are solved through search mechanisms.
Constraint: A limitation or restriction. " Time constraints make it impossible to do everything "
A constraint satisfaction problem (CSP) is characterized by a set of variables. Each variable has a possibly infinite domain of values and a set of domain constraints. A solution to a CSP assigns a value consistent with the domain constraints to each variable. A constraint is a related condition, (or predicate), that must hold among a set of variables.
Search related terms
The Search strategies are evaluated in the following dimensions :
-
◊ (^) Performance of an algorithm depends on the internal and external factors.
External Factors
‡ Size of input
‡ Speed
‡ Quality of the compiler
Internal Factors
‡ Time required, to run the algorithm
‡ Space (memory) required to run computer
◊ Complexity^ is a measure of the performance of an algorithm.
It measures the internal factors, usually in time than space.
- (^) Big-O ” notation
The Big-O notation is used to give an approximation to the
run-time efficiency of an algorithm; the letter “O” is for Order
of magnitude of operations or space at run-time.
Algorithm’s Performance and Complexity: Ideally we want a common measure so that we can compare approaches in order to select the most appropriate algorithm for a given situation.