lecture 2 Flashcards
a formal definiton of a problem
- The set of states S with an initial state s0.
- the sets of actions As available at any state s.
- The transition functions Ts : As to S for any s
- The set of goal states F9- S.
- The solution criterion (costs assigned to actions)
Time and space complexity
Th time and space required as an asymptotic function (using O(.) notation) of the input size.
completeness
whether a solution is found if one exissts
optimality
whether the solution returned is optimal
Breadth - first search
Intuitvely: explore nodes in the order in which we reach them.
*formally: The frontier is a (first in , first out ) queue.
- always finds the shortest solution (complete and optimal).
- it is of exponential (time and space) complexity.
Depth-first search
Intuitively: explore a node as soon as we reach it.
Formally: the frontier is a (last in, first out) stack.
- Total number of nodes visited id O(b^w), but space only O(b*w).
- it is incomplete for infinite depth, and need not be optimal (when searching graphs or with multiple goal states).
Dijkstra algorithm (lowest - cost first search)
Intuitively: explore the shorter possibilities first.
Formally: the frontier is a (weight-sum-based) priroity qeue,
a node isn’t considered reached until we exploore it, and when a node is explored we remove all other paths ending at that node.
The solution it returns is guaranteed to be optimal.
*but…it can fail to terminate on infinitely small weights.
*it is again exponential (time and space) complexity O(b^d)
A* search algorithm
Intuitivley: taking into account the direction in which our destination lies and factor this into our search strategy.
formally: we dfine a height function, and for every arc(s,s’) we subtract h(s) - h(s’) from its weight w(s,s’)
* we call h admissible if for all s we have h(s) <= d(s,t).
* we cal h consistent if for all s, s’ we have h(s) <= w(s,s’) + h(s’).
* given that h is admissible, A* remains optimal.
Heuristics
in A* height function h servers as a heuristic which guides us through the search space more efficiently, while keeping optimality.
*whne we wre willing to settle for a less than optimal answer we can also use heuristics such as greedy best-first.
here we optimize sololey in terms of the heuristics, for instance by always taking the option which minimizes the Euclidean distance to the target, disregarding the costs involved.
closing remarks of lecture 1
- There is no perfect info about the state space.
- Transitions are probabilistic instead of deterministic.
- States cannot be considered discrete in a meaningful way.
8Thre are multiple agents acting on the state space.