The search algorithm is a method of exhaustion of a problem with a high performance of the computer, resulting in a method of solving the problem. The search process actually constructs a solution tree based on the initial condition and extension rules and finds a node that meets the target state. All search algorithms are implemented from its final algorithm, can be divided into two parts - control structure and generating systems, and all algorithms are optimized and improved by modifying their control structures. It is now mainly discussed, so the system is made as follows: function expendnode (Situation: Tsituation; ExpendwayNo: Integer): Tsituation; indicates that the node status SITUTION is expanded with the EXPENDWAYNO expansion rule, and Returns the state after the extension. (The algorithm description language used herein is PASCAL.) 1. The backtracking algorithm is the most basic algorithm in all search algorithms. It uses a "walking" ideas as its control structure, which is quite A method of constructing a hot-traversed approach is used to find or all solutions and optimal solutions. The specific algorithm is described as follows: [Non-intended algorithm]
Evaluation: The retractable algorithm has less consumption of space. When it is used with the branching boundary method, there is a good effect on the problem of the level of the solution in the solution tree. However, it should be avoided in the same problem with the relay node to avoid cycling. Second, depth search and the intensive control structure and generating system of breadth search and generating systems are very similar, and the unique difference is to select the extension node. Since it retains all the relay nodes, a part of the repeated nodes can be removed when the subsequent node is generated, thereby improving search efficiency. Both algorithms extend all child nodes of a node each time, and differences, depth search next extension is one of this extended child node, and the breadth sexy expansion is this extended node Brother node.
In the specific implementation, in order to improve efficiency, different data structures are used. [Search] Open [OpenL]. Situation: = new-S; Open [OpenL] .level: = Close [Closel] .level 1; Open [OpenL] .last: = closel; end-if end-for; END; example: Maze problems, solve the shortest path and the accessible path. Evaluation: Bright Search is a better way to solve the optimal solution, which will be further optimized later. Depth search is mostly required to only be demanded, and the repetitive nodes in the solution tree are used more and repeatedly, it is often used, but it is often replaced by a branching or retrieval algorithm. http://www.mydrs.org big banyan tree