人工智能(二) LeeRinji

搜索(Search)

很多人工智能的问题都可以用搜索来求解(例如博弈)

形式化方法

Once the problem has been formulated as a state space search, various algorithms can be utilized to solve the problem.

A solution to the problem will be a sequence of actions/moves that can transform your current state into state where your desired condition holds.

将一个问题形式化为搜索问题的组分如下:

搜索算法

Inputs

Output

树形搜索

TreeSearch(Frontier, Sucessors, Goal? )
  If Frontier is empty return failure
  Curr = select state from Frontier
  If (Goal?(Curr)) return Curr.
  Frontier’ = (Frontier – {Curr}) U Successors(Curr)
  return TreeSearch(Frontier’, Successors, Goal?)

无访问标记,可能导致搜索不会终止。

Selection rule(选择方式)

The example shows that the order states are selected from the frontier has a critical effect on the operation of the search:

Critical Properties of Search(关键要素)

Completeness(完备性)

will the search always find a solution if a solution exists?

Optimality(最优性)

will the search always find the least cost solution? (when actions have costs)

Time complexity(时间复杂度)

what is the maximum number of nodes than can be expanded or generated?

Space complexity(空间复杂度)

what is the maximum number of nodes that have to be stored in memory?

Selecting vs. Sorting

Breadth-First

Place the successors of the current state at the end of the frontier.

将当前状态的后继者放置在边界的末尾。

Breadth First Properties
Completeness and optimality

Depth-First

Applied to the example of Breadth First Search

Depth first properties
Time complexity
Space complexity

Uniform-cost(一致代价)

Completeness and optimality
Time and space complexities

Depth-limited search(深度受限搜索)

Depth-limited properties

Iterative deepening search(迭代加深搜索)

Completeness and optimality
Time and space complexities

Path checking

Cycle checking / multiple path checking

Issue with optimality

Path / cycle checking

The missionaries and cannibals problem
Formulation of the MC problem