beam search

来源:互联网 发布:产品目录设计软件 编辑:程序博客网 时间:2024/06/05 02:35

Artificial Intelligence/Search/Heuristic search/Beam search

< Artificial Intelligence‎ | Search

Contents

  [hide] 
  • 1 Definition
  • 2 Search Components and Algorithm
  • 3 Advantages, Disadvantages, and Practical Applications
  • 4 References







Artificial Intelligence/Search

< Artificial Intelligence

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]

  • A* search
  • Beam search
  • Best-first search
  • Bidirectional search
  • Breadth-first search
  • Depth-first search
  • Dijkstra's algorithm
  • Finite state automate
  • Hill climbing
  • Minimax search
  • Recommender systems
  • Tabu search















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


禁忌搜索算法

百科名片

tabu搜索算法建立的解决配电的数学模型  
tabu搜索算法建立的解决配电的数学模型
禁忌(Tabu Search)算法是一种亚启发式(meta-heuristic)随机搜索算法1,它从一个初始可行解出发,选择一系列的特定搜索方向(移动)作为试探,选择实现让特定的目标函数值变化最多的移动。为了避免陷入局部最优解,TS搜索中采用了一种灵活的“记忆”技术,对已经进行的优化过程进行记录和选择,指导下一步的搜索方向,这就是Tabu表的建立。

目录

简介
伪码表达
其他算法

编辑本段简介

又名“tabu搜索算法”
为了找到“全局最优解”,就不应该执着于某一个特定的区域。局部搜索的缺点就是太贪婪地对某一个局部区域以及其邻域搜索,导致一叶障目,不见泰山。禁忌搜索就是对于找到的一部分局部最优解,有意识地避开它(但不是完全隔绝),从而获得更多的搜索区间。兔子们找到了泰山,它们之中的一只就会留守在这里,其他的再去别的地方寻找。就这样,一大圈后,把找到的几个山峰一比较,珠穆朗玛峰脱颖而出。
当兔子们再寻找的时候,一般地会有意识地避开泰山,因为他们知道,这里已经找过,并且有一只兔子在那里看着了。这就是禁忌搜索中“禁忌表(tabu list)”的含义。那只留在泰山的兔子一般不会就安家在那里了,它会在一定时间后重新回到找最高峰的大军,因为这个时候已经有了许多新的消息,泰山毕竟也有一个不错的高度,需要重新考虑,这个归队时间,在禁忌搜索里面叫做“禁忌长度(tabu length)”;如果在搜索的过程中,留守泰山的兔子还没有归队,但是找到的地方全是华北平原等比较低的地方,兔子们就不得不再次考虑选中泰山,也就是说,当一个有兔子留守的地方优越性太突出,超过了“best so far”的状态,就可以不顾及有没有兔子留守,都把这个地方考虑进来,这就叫“特赦准则(aspiration criterion)”。这三个概念是禁忌搜索和一般搜索准则最不同的地方,算法的优化也关键在这里。

编辑本段伪码表达

procedure tabu search;
begin
initialize a string vc at random,clear up the tabu list;
cur:=vc;
repeat
select a new string vn in the neighborhood of vc;
if va&gt;best_to_far then {va is a string in the tabu list}
begin
cur:=va;
let va take place of the oldest string in the tabu list;
best_to_far:=va;
end else
begin
cur:=vn;
let vn take place of the oldest string in the tabu list;
end;
until (termination-condition);
end;
以上程序中的关键在于:
  1. 禁忌对象:可以选取当前的值(cur)作为禁忌对象放进tabu list,也可以把和当前值在同一“等高线”上的都放进tabu list。
  2. 为了降低计算量,禁忌长度和禁忌表的集合不宜太大,但是禁忌长度太小容易循环搜索,禁忌表太大容易陷入“局部极优解”。
  3. 上述程序段中对best_to_far的操作是直接赋值为最优的“解禁候选解”,但是有时候会出现没有大于best_to_far的,候选解也全部被禁的“死锁”状态,这个时候,就应该对候选解中最佳的进行解禁,以能够继续下去。
  4. 终止准则:和模拟退火,遗传算法差不多,常用的有:给定一个迭代步数;设定与估计的最优解的距离小于某个范围时,就终止搜索;当与最优解的距离连续若干步保持不变时,终止搜索;
  5. 邻域:由伪码 select a new string vn in the neighborhood of vc,可以看出,系统总是在初始点的邻域搜索可能的解的,因而必须定义适合的邻域定义,如果解空间的存在一个最优解X*,初始搜索点为S0,那么如果S0不存在到达X*的通路,就会使搜索陷入S0的邻域的局部最优解。可以证明如果邻域满足对称性条件,则在假设禁忌表足够长的情况下必然可搜索到全局最优解。

编辑本段其他算法

禁忌搜索是对人类思维过程本身的一种模拟,它通过对一些局部最优解的禁忌(也可以说是记忆)达到接纳一部分较差解,从而跳出局部搜索的目的.
遗传算法是基于生物进化的原理发展起来的一种广为应用的、高效的随机搜索与优化的方法。其主要特点是群体搜索策略和群体中个体之间的信息交换,搜索不依赖于梯度信息。
蚂蚁算法是群体智能可用于解决其他组合优化问题,比如有n个城市,需要对所有n个城市进行访问且只访问一次的最短距离。


原创粉丝点击