420 likes | 432 Views
Explore various search strategies including Uninformed, Informed, Depth-first, Greedy Best-first, and A* search. Learn about heuristic functions and optimization with examples.
E N D
INC 551 Artificial Intelligence Lecture 3
Search technique • Uninformed search • Breadth first • Uniform cost search • Depth first • Depth-limit search • Bidirectional search • Informed search • Greedy best-first • A* search
Depth-limited Search Depth-first ที่มีการกำหนด depth มากสุดในการ search
Characteristicof Depth-limit search Complete – no Search Time – มาก Space – น้อย (linear space) Optimal – no
Iterative Deepening Depth-first Search มีการกำหนด depth มากสุดซึ่งจะทำซ้ำโดยเพิ่ม depth ขึ้นเรื่อยๆ ถ้ายังไม่ถึง goal
Characteristic ของ Iterative Deepening Depth-first search Complete – yes Search Time – มาก Space – น้อย (linear space) Optimal – no(yes ถ้า path cost = 1 ทุกอัน)
Real Number:Iterative Deepening Depth-first search Depth-first B=10, d=5 1+10+100+1,000+..+100,000=111,111 Iterative Deepening Depth-first B=10, d=5 6+50+400+3,000+..+100,000=123,456
Search technique • Uninformed search • Breadth first • Uniform cost search • Depth first • Depth-limit search • Bidirectional search • Informed search • Greedy best-first • A* search
Bidirectional Search จะ search จากทั้ง start และ goal เพื่อลดจำนวน state จาก bdเป็น bd/2+ bd/2
Expand ทั้ง start และ goal จนมาชนกัน
Water Jug Puzzle 11 , 9 , 0 10 , 10 , 0
Search Strategies • Data Driven Search • (Start from the origin and work forward) • Goal Driven Search • (Start from the goal and work backward)
Search technique • Uninformed search • Breadth first • Uniform cost search • Depth first • Depth-limit search • Bidirectional search • Informed search • Greedy best-first • A* search
Informed?? ด้วยข้อมูลอะไร? ข้อมูลนี้เรียก “heuristic” Heuristic คือ แนวทางในการแก้ปัญหาซึ่งมาจาก ความฉลาดและประสบการณ์ของมนุษย์ Heuristic function h(n) Take input = state ใดๆ output = คะแนนบอกว่า state นั้นดีแค่ไหน
คุณสมบัติของ Heuristic • มาจากความฉลาดของมนุษย์ในการแก้ปัญหาใดๆ • ขึ้นกับปัญหานั้นๆ / มีได้หลายแบบ • อาจผิดหรือถูกก็ได้
Example Heuristic ใน navigation problems ส่วนมากจะใช้ “Euclidian distance to goal” a Goal b Start c
Heuristic ไม่จำเป็นต้องดี/ถูกเสมอไป ทางขาด a Goal b Start c
Search technique • Uninformed search • Breadth first • Uniform cost search • Depth first • Depth-limit search • Bidirectional search • Informed search • Greedy best-first • A* search
Greedy Best-first Search จะ expand node ที่มีค่า heuristic มากที่สุด (node ที่ใกล้ goal ที่สุดใน navigation problem) f(n) = h(n)
Example Start Goal
CharacteristicofGreedy Best-first Search Complete – no Search Time – depend on heuristics Space – depend on heuristics Optimal – no
Search technique • Uninformed search • Breadth first • Uniform cost search • Depth first • Depth-limit search • Bidirectional search • Informed search • Greedy best-first • A* search
A* search Idea: avoid expanding the nodes that are already expensive f(n) = g(n)+h(n) f(n) = evaluation function decide which node to expand g(n) = cumulative cost h(n) = heuristic Note: A* is optimal
A* Termination Criterion Stop when A* chooses to expand the goal node. (different from others where the search ends when goal node is found)
Characteristicof A* search Complete – yes Search Time – depend on heuristics Space – depend on heuristics Optimal – yes
Different Heuristics on A* H1 = จำนวนชิ้นที่อยู่ผิดตำแหน่ง H2 = ผลรวม Manhattan distance ของตำแหน่งปัจจุบันถึงตำแหน่งที่ต้องการของแต่ละชิ้น
Depth=14 IDS = 3473941 nodes A*(h1) = 539 nodes A*(h2) = 113 nodes Depth=24 IDS = ?? A*(h1) = 39135 nodes A*(h2) = 1641 nodes เรียก h2 dominates h1