Artificial Intelligence/Search/Heuristic search/Beam search
Contents[hide] |
Artificial Intelligence/Search
Introduction [edit]
The general concept of ‘searching’ is about looking for something. For example, we want to drive to some destination and we need to find the car key. Locating the car key is a simple search problem. In computer science, searching techniques are strategies that look for solutions to a problem in a search space. The solutions or ‘goal states’ could sometimes be an object, a goal, a sub-goal or a path to the searched item. In the car key example, the search goal is the car key and the search space is confined to the owner’s home. The car key can be located anywhere in the owner’s house.
In general, a computer search problem has the following characteristics:
- A goal state – the definition of a need
- An initial state – a current position or a set of conditions
- A set of actions - strategies and actions to select and evaluate an option in the search space
- Goal test criteria – criteria used to test if an option is a solution
- A path cost - the cost of the actions in a search path
Search Space [edit]
The search space can be represented by a ‘graph’ which is based on graph theory. The ‘graph’ structure is not to be confused with the graphs that the readers might have learned from their regular mathematics courses. A computer ‘tree’ data structure is a special kind of graph. A tree has a root node on the top of the structure and it has at most one path to each node. Each node may be connected to a lower level of neighbors which are called child nodes (successors). Nodes that have no children are called leaf nodes.
Using the car key example, the owner’s home is defined as the search space. It has the ‘home’ node as the root of a tree. The home node has three child nodes (the room nodes) and other child nodes such as desks and drawer in the rooms.
Kinds of Search [edit]
Definition [edit]
Beam search is a restricted, or modified, version of eithera breadth-first search or a best-first search. It is restricted in the sense that the amount of memory available for storing the set of alternative search nodes is limited, andin the sense that non-promising nodes can be pruned at any step in the search (Zhang, 1999). The pruning of non-promising nodes is determined by problem-specific heuristics (Zhang, 1999). The set of most promising, or best alternative, search nodes is called the “beam” (Xu and Fern, 2007). Essentially, beam search is a forward-pruning, heuristic search.
Search Components and Algorithm [edit]
A beam search takes three components as its input: a problem to be solved, a set of heuristic rules for pruning, and a memory with a limited available capacity (Zhang, 1999). The problem is the problem to be solved, usually represented as a graph, and contains a set of nodes in which one or more of the nodes represents a goal. The set of heuristic rules are rules specific to the problem domain and prune unfavourable nodes from the memory in respect to the problem domain. The memory is where the “beam” is stored, where when memory is full and a node is to be added to the beam, the most costly node will be deleted, such that the memory limit is not exceeded.
The following algorithm for a beam search, as a modified best-first search, is adapted from Zhang’s 1999:
beamSearch(problemSet, ruleSet, memorySize)
openMemory = new memory of size memorySize
nodeList = problemSet.listOfNodes
node = root or initial search node
Add node to openMemory;
while (node is not a goal node)
Delete node from openMemory;
Expand node and obtain its children, evaluate those children;
If a child node is pruned according to a rule in ruleSet, delete it;
Place remaining, non-pruned children into openMemory;
If memory is full and has no room for new nodes, remove the worst
node, determined by ruleSet, in openMemory;
node = the least costly node in openMemory;
Advantages, Disadvantages, and Practical Applications [edit]
Beam search has the advantage of potentially reducing the computation, and hence the time, of a search (Xu and Fern, 2007). As well, the memory consumption of the search is far less than its underlying search methods (Furcy and Koenig). This potential advantage rests uponthe accuracy and effectiveness of the heuristic rules used for pruning, and having such rules can be somewhat difficult due to the expert knowledge required of the problem domain (Zhang, 1999). The main disadvantages of a beam search are that the search may not result in an optimal goal and may not even reach a goal at all. In fact, the beam search algorithm terminates for two cases: a required goal node is reached, or a goal node is not reached and there are no nodes left to be explored (Zhang, 1999). Beam search has the potential to be incomplete. Despite these disadvantages, beam search has found success in the practical areas of speech recognition, vision, planning, and machine learning (Zhang, 1999).
References [edit]
- Zhang, W. (1999). State-space search: Algorithms, complexity, extensions, and applications. Springer: New York.
- Xu, Y., Fern, A. (2007). On learning linear ranking functions for beam search. Retrieved on March 8, 2009, fromhttp://www.machinelearning.org/proceedings/icml2007/papers/168.pdf
- Furcy, D., Koenig, S. Limited discrepancy beam search. Retrieved on March 8, 2009, from http://www.ijcai.org/papers/0596.pdf
禁忌搜索算法
百科名片
编辑本段简介
编辑本段伪码表达
-
禁忌对象:可以选取当前的值(cur)作为禁忌对象放进tabu list,也可以把和当前值在同一“等高线”上的都放进tabu list。
-
为了降低计算量,禁忌长度和禁忌表的集合不宜太大,但是禁忌长度太小容易循环搜索,禁忌表太大容易陷入“局部极优解”。
-
上述程序段中对best_to_far的操作是直接赋值为最优的“解禁候选解”,但是有时候会出现没有大于best_to_far的,候选解也全部被禁的“ 死锁”状态,这个时候,就应该对候选解中最佳的进行解禁,以能够继续下去。
-
终止准则:和模拟退火, 遗传算法差不多,常用的有:给定一个迭代步数;设定与估计的最优解的距离小于某个范围时,就终止搜索;当与最优解的距离连续若干步保持不变时,终止搜索;
-
邻域:由伪码 select a new string vn in the neighborhood of vc,可以看出,系统总是在初始点的邻域搜索可能的解的,因而必须定义适合的邻域定义,如果解空间的存在一个最优解X*,初始搜索点为S0,那么如果S0不存在到达X*的通路,就会使搜索陷入S0的邻域的局部最优解。可以证明如果邻域满足对称性条件,则在假设禁忌表足够长的情况下必然可搜索到全局最优解。