Spaces and Search Algorithms: Tc2011 Artificial Intelligence
Spaces and Search Algorithms: Tc2011 Artificial Intelligence
examine the search space is a serious consideration in terms of efficiency since there are many ways to combine the data to reach a goal or solution.
The Water Jugs Problem
Imagine that you have two jugs called X and Y. Initially, both are empty. You are allowed to fill either jug X or jug Y from a tap but if you do, you have to fill it completely. You are also allowed to fill jug X from jug Y, or jug Y from jug X, and to empty either jug on the ground. Jug X can hold 4 pints and jug Y can hold 3 pints. The objective is to leave 2 pints in one of the jug.
Search Depth
In the case of node structures or large frames, it is desirable to limit the exertion used in the search for solutions or inherited values in frame systems. FLEX provides a means to impose a maximum depth of search, for this situation, using a default of 9 levels; this is independent from the search technique used.
My_other_ cat
Felix
Evaluation
It is a complete search - Excellent for operators of unit cost (the costs do not change or even better the costs never decrease). - Its time and space complexity is O(bd), where d is the depth of the solution and b is the arity of the tree. Its Space complexity makes it impractical for many cases.
2. UNIFORM SEARCH
It is a modified breadth-first search through the selection of the cheapest route. All routes are saved in a list or stack and the solution is not recognized until they are processed (extracted) from the list, all routes that have been traveled. Example: /--------- A ---------\ 1 10 / \ S ------5----- B ----5------ Meta \ / 15 5 \---------- C --------/
Evaluation
It is a complete search Optimal if the uniform cost is always increasing, ie. There are no negative cost values, operators dont require to be unitary (to have different costs.) Its time complexity is equal to the breadth-first search: O(bd), where d is the depth of the solution and b is the arity of the tree.
3. DEPTH-FIRST
This search algorithm applied to a network node or a hierarchy of frames, will expand an entire branch from the root to reach the leaves, before visiting ancestors. The searches are performed from left to right.
Animal 1
Cat
5 Evaluation
-
My_other_cata t
7 Felix
Its an incomplete search; it can get stuck when entering the wrong path. It is not optimal. This search always goes down without returning, even if there exists a solution from a node with a lesser depth. Its time complexity is O (bm) and space complexity of O (bm), where m is the maximum depth and b is the arity of the tree.
Criteria
This algorithm combines the benefits of breadth-first searches and depth-first searches: - It is complete and optimal, such as breadth-first search. - It has the memory requirements of depth-first search. The downside is that many states are expanded multiple times. > This is the preferred method when the search space is large and the depth of the solution is unknown.
BIDIRECTIONAL SEARCH
The idea of this method is to expand simultaneously from the source and from the target, until both searches meet in the middle. This method is only applicable when the arity b of the network is the same in both directions, and if so, the search can make a huge difference having a space complexity of O(bd/2). For example, for b = 10 and d = 6, breadth-first search generates 1'111, 111 nodes, while the bidirectional search generate only 2,222 nodes in each direction. The disadvantage is that its implementation is more complex.
Where
b - branching factor s - depth of the solution m - maximum depth of the tree (from root to the leaf with the longest route) l - limit of the search depth (# of search levels )
---------------------------------------------------------------------------------------------HOMEWORK 2:
Implement a Prolog database to represent the knowledge of problem solving of photography expressed in the delivered photocopy (Bowen, Appendix E).
----------------------------------------------------------------------------------------------
SPACE SOLUTIONS Home Receiving Products Corridor Office (Bomba) ..... Studio ... 2 0 1
Calgary
2500
800
1000
New York
1500
New York
1000
Chicago
MC2
Toronto
800 MC1
1900 HC1
Denver
1000 HC2
1
Denver
1500 HC3
Los Angeles
Solucin Min-Cost
Calgary Chicago
Los Angeles
Solution Min-Cost
Los Angeles
Houston
1500 HC4
Multiple Solutions When a problem requires many different solutions to a problem it is possible to use generating methods of multiple solutions, such as: Path Removal: It consists of removing all the nodes that lead to the current solution from the database and then trying to find another solution, i.e. pruning tree branches Node Removal: Removes only the last node in the path of the current solution and then tries to find another solution. Optimal Solution The optimal solution to a search problem can only be performed through exhaustive search. The best way to do a search (non-exhaustive) is combining a method of multiple solutions with one of the heuristics above. These include the path removal, generating multiple solutions and the search for mincost to minimize the distance.