Lesson 2_Uninformed search methods

来源:互联网 发布:js判断变量是否为对象 编辑:程序博客网 时间:2024/06/11 01:03

Lesson 2_Uninformed search methods

Reflex agents

  • Choose action based on current percept( and maybe memory)
  • May have memory or a model of the world’s current state
  • Do not consider the future consquences of their actions
  • Consider how the world IS

Planning agents

  • Ask what if
  • Decisions based on the consquences of acitons
  • Must have a model of how the world evolves in response to actions
  • Must formulate a goal
  • Consider how the world WOULD BE

Search problem

  • A state space: models how the world is
  • A successor function(with actions, cost):models how the world evolves in response to your actions
  • A start state and a goal test
    A solution is a sequence of actions(a plan) that transforms the start state to a goal state.
    The world state is includes every last detail of the environment, while the search state keeps only the details needed for planning(abstraction).

Search tree

  • A “what if” tree of plans and their outcomes
  • The start state is the root node
  • Children correspond to successors
  • Nodes show states, but correspond to PLANS that achieve these states
  • For most problems, we can never actually build the whole tree

Search with a search tree

Tree-Search:
- Expand out potential plans(tree nodes)
- Maintain a fringe of partial plans under consideration(This fringe is plans that we are still considering that may lead us to a goal)
- Try to expand as few as nodes as possible

1 Breadth-First Search(广度优先搜索):

Root node expands first, then all the nodes generated by the root node expand next, and then their successors, and so on.
BFS search can be implemented by calling the TREE-SEARCH algorithm.(how to do?)
BFS Search properties:(s-the depth of shallowest solution; b-branching factor, namely how many child nodes under a parent node in average)
- Time complexity: O(bs)
- Space complexity: O(bs)
- Compelte: yes, always be able to find a solution if exists
- Optimal: depends on the costs

2 Depth-First Search(深度优先搜索):

Depth-First Search always expands one of the nodes that at the deepest level of the tree. Only when the search hits a dead end does the
DFS search can be implemented by calling the TREE-SEARCH algorithm.(how to do?) Or use a recursive function that calls itself on each of its children in turn.
DFS Search properties:(m-the depth of tree, if finite; b-branching factor, namely how many child nodes under a parent node in average)
- Time complexity: O(bm)
- Space complexity: O(bm)
- Compelte: m could be finite, so only if we prevent cycle
- Optimal: no
Depth-First search should be avoided for search trees with large or infinite maximum depths

BFS vs DFS search: When the solution is kind of not so far, or the depth is infinite while there is solution, or you care about the lenth, then you may choose the Breadth-First Search; While when the graph isn’t actually very deep, or the solutions are all down there at the bottom, then you may prefer the Depth-First Search.

3 Uniform-Cost Search(代价一致搜索):

Uniform-Cost Search modifies the BFS strategy by always expanding the lowest-cost node on the fringe(as measured by the path cost g(n)), rather than the lowest-depth node.
A simple requirement: the cost of a path never decrease as we go along the path. In other words, we insist that:g(SUCCEESSOR(n))g(n)
UCS Search properties:(if solution costs C and arcs cost at least e, then the “effective depth” is roughly Ce )
- Time complexity:O(b(Ce))
- Space complexity: O(b(Ce))
- Compelte:yes
- Optimal:yes

4 Depth-limited search(深度有限搜索):

Set a limit depth L

5 Iterative deepening search(迭代深入深度优先搜索):

Iterative deepening search is a strategy that sidesteps the issue of choosing the best depth limit by trying all possible depth limit: first depth 0, then depth 1, then depth 2, and so on. It combines the benefits of depth-first search and breadth-first search, and it’s complete and optimal.
IDS search properties:(d-the depth of solution)
- Time complexity: O(bd)
- Space complexity: O(bd)
- Compelte: yes
- Optimal:yes

6 Bidirectional Search(双向搜索):

Search both forward from the initial state and backward from goal state, and stop when the two searches meet in the middle.
Several issues:
- Predecessors: predecessors of a node n to be all those nodes that have n as a successor, and search backwards means generating predecessors successively starting from the goal node.
- If operators are reversible, then predecessors and successors set are identical.
- There must be an efficient way to check each node to see whether they meet.
- Select what kind of search in each half.
BS search properties:
- Time complexity: O(b(d2))
- Space complexity:O(b(d2))
- Compelte: yes
- Optimal:yes

祝枫
2016年9月21日于哈工大

0 0
原创粉丝点击