Title: ??????? (Problem-Solving and Searching Methods)
1Chapter 2
- ??????? (Problem-Solving and Searching Methods)
2????
- ?????????????????,????????????????????????????
- ?????????????,?????????????????????? ?
32.1 ???? (Problem formulation)
- ???????????????,?????????????????
-
- ??????????????????????,????????????????????????
42.1.1 ??????????(Well-defined problems and
solutions)
- ??????????????????
- ??(states)
- ??(actions)
52.1.1 ??????????(Well-defined problems and
solutions)
- ?????????
- ????(initial state)?
- ??????(operator)????
- ??????(state space)
- ????(path)
- ??????(goal test)
- ??????(path cost)
62.1.1 ??????????(Well-defined problems and
solutions)
- ????????????(Finite state machine)???,????????????
???? - ????????????????????????,??????????????
lt?2.1 gt???????????
72.1.2 ??????? (Measuring problem-solving
performance)
- ????????????,??????????????
lt?2.2gt ????WHILE?WRITE?BEGIN???????
82.1.2 ??????? (Measuring problem-solving
performance)
- ????????????????(Problem space),????????????????,?
???????????? - ????????????????????,????????????,??????????
92.1.2 ??????? (Measuring problem-solving
performance)
- ????
- ????
- ???????????
- ????
- ????
lt?2.3gt ??????????
102.1.2 ??????? (Measuring problem-solving
performance)
- ?????????????????????,? (a)????????(traveling
Salesman)???
112.1.2 ??????? (Measuring problem-solving
performance)
- ? (b)????A?????,????????????,?ABDCA?ACDBA?
122.1.2 ??????? (Measuring problem-solving
performance)
- ???????????????????????
- ????????????????????,??????????????????
132.1.2 ??????? (Measuring problem-solving
performance)
- ?2.1???????????????????????
?? ?????
????? ?????????
?????????? ????????
????????? ???????,???????
????????? ????????
?????????? ???????????
???? ???????
lt?2.1gt ???????????
142.1.2 ??????? (Measuring problem-solving
performance)
- ?????????????????????????????,????????????????????
- ??????,??????????,????????????????
152.1.2 ??????? (Measuring problem-solving
performance)
- ???????????????,??????????,????????????,??????????
??? - ???,??????????????????,???????????
162.1.2 ??????? (Measuring problem-solving
performance)
- ?????????????????
- (1)?????????
- (2)?????????
- (3)?????????????????????
- ?????????????????????
172.1.3 ???????? (Choosing states and actions)
- ??????????????????????????????????????????????
182.1.3 ???????? (Choosing states and actions)
- ?????????,???????????????,?????????
- ??????????????????(abstraction)?
192.1.4 ????-???????? (the 8-puzzle problem)
- ?2.6??3 x 3????,???8????????,???????
- ?????????????????
lt?2.63 x 3???gt
202.1.4 ????-???????? (the 8-puzzle problem)
- ?????????????,????????????????????,???????????????
???????????????,??????? - ????????????????????????????????,???????????
- ???????????????
- ???????????2.6????????
- ??????????1,?????????????
212.1.4 ????-???????? (the 8-puzzle problem)
- ??????????????,???????NP-complete,??????????????,?
???????????????????? - ??15??????????????????????????????????
222.2 ???? (Searching Strategies)
- ???????????????,??????????????????????
- ????????????,??????1????d??????????,??????d1?
232.2.1 ??????? (General search algorithm)
- ?2.7???????????????????????????
- ????????????????????????????,?????????17???,??????
?????,?????????????????
242.2.1 ??????? (General search algorithm)
lt?2.7gt ??????????????
252.2.1 ??????? (General search algorithm)
- ???????
- GENERAL-SEARCH (????, ??) ?? ?? ? ????
- ???????????
- ???????
- IF ???????? THEN?? ????
- ??????????????
- IF ??????????then?? ??
- ELSE ?????????????
26?????
- ???(Completeness)
- ?????(Time complexity)
- ?????(Space complexity)
- ???(Optimality)
272.2.2 ???????? (Breadth-first search)
- ??????,????????,????????????????,?????????????
- ??????????,??????d????????????d1????????
282.2.2 ???????? (Breadth-first search)
- ?????????????????????????,??????????(Queuing
function)???????????????
function BreadthFirst-Search (????) ?? ?? ? ????
?? GENERAL-SEARCH (????, ??????????????)
292.2.2 ???????? (Breadth-first search)
- ??????????????????,????????????1???,????????2????
? - ?????,??????????????
- ????????,????????????????????
lt?2.8gt ??????????
302.2.3???????? (Depth-first search)
- ???????????????????????????,??????????,????????,??
???????????
312.2.3???????? (Depth-first search)
- ???????????????????,??????????????
function DEPTH-FIRST-SEARCH (????) ?? ?? ? ????
??GENERAL-SEARCH (????, ??????????????)
322.2.3???????? (Depth-first search)
- ????????????,????????????,??2.9???
lt?2.9gt ?????????
332.2.3???????? (Depth-first search)
- ???????????,?????????????
-
- ????????????????????????????????????
342.2.3???????? (Depth-first search)
- ????????????,?????????????????
- ???????,??????????????,???????????,??????????????
352.2.4. ?????????(best-first search)
- ?????????????????????????????
- ???????????,???????????
- ??,?????????,????????????
362.2.4. ?????????(best-first search)
- ????????????????,????????????????
- ???????,?????????????????????????????
372.2.4. ?????????(best-first search)
- ????????????????????????????
function BEST-FIRST-SEARCH (????, ????) ?? ?? ?
???? ???? ? ??????????????
??GENERAL-SEARCH (????, ????)
382.2.4. ?????????(best-first search)
- ???????,????o,???x,????????
- F(x)???????????????1
- ????????o???2 Y(X)
- Y(X) 0 ?????????x???0
- 1 ?????????x???1
- 2 ?????????x???2
392.2.4. ?????????(best-first search)
A1 A2 A3
A4 A5 A6
A7 A8 A9
402.2.4. ?????????(best-first search)
- ??????,?
- F(A1)(222) ?1 (000) ? 2 (000) 6
- F(A2)(22) ?1 (00) ? 2 (00) 4
- F(A3)(222) ?1 (000) ? 2 (000) 6
- F(A4)(22) ?1 (00) ? 2 (00) ? 2 4
- F(A5)(2222) ?1 (000) ? 2 (000) 8
- F(A6)(22) ?1 (00) ? 2 (00) 4
- F(A7)(222) ?1 (000) ? 2 (000) 6
- F(A8)(22) ?1 (00) ? 2 (00) ? 2 4
- F(A9)(222) ?1 (000) ? 2 (000) ? 2 6
412.2.4. ?????????(best-first search)
X A2 A3
A4 O A6
A7 A8 A9
422.2.4. ?????????(best-first search)
- ????????,???
- F(A2)(11) ?1 (10) ? 2 (-10) 3
- F(A3)(112) ?1 (010) ? 2 (-100) 5
- F(A4)(11) ?1 (10) ? 2 (0-1) 3
- F(A6)(12) ?1 (10) ? 2 (00) 5
- F(A7)(112) ?1 (010) ? 2 (-100) 5
- F(A8)(12) ?1 (10) ? 2 (00) 5
- F(A9)(022) ?1 (010) ? 2 (0-10) 5
432.2.4. ?????????(best-first search)
- ????,A3?A6?A7?A8 ?A9???????,??????A3?????A7,?????
??
X A2 O
A4 O A6
X A8 A9
442.2.4. ?????????(best-first search)
- ????????,???
- F(A2)(01) ?1 (11) ? 2 (-10) 4
- F(A4)(01) ?1 (01) ? 2 (40) 7
- F(A6)(11) ?1 (11) ? 2 (00) 6
- F(A8)(11) ?1 (01) ? 2 (-10) 3
- F(A9)(101) ?1 (011) ? 2 (-100) 5
452.2.4. ?????????(best-first search)
X A2 O
O O X
X A8 A9
462.2.4. ?????????(best-first search)
- ????????,???
- F(A2)(01) ?1 (11) ? 2 (-10) 4
- F(A8)(11) ?1 (01) ? 2 (-10) 3
- F(A9)(100) ?1 (011) ? 2 (-10-1) 3
472.2.4. ?????????(best-first search)
X O O
O O X
X X A9
48???????(Depth-limited Search)
- ????Depth-First Search????????????????
- ?????????????
- ???????????
49???????(Iterative Deepening Search)
- ??for???????????,?????depth-limited search
- ?????depth-first search?breadth-first search???
- ??????????
50???????(b??branch?d??depth)
?? Breadth-first Depth-first Best-first Depth-limited ?????
Time bd bm bd bl bd
Space bd bm bd bl bd
??? Yes No Yes No Yes
??? Yes No Yes Yes, if lgtd Yes