SEARCHING 2 KECERDASAN BUATAN Metode Pencarian Heuristik Heuristik
SEARCHING (2) KECERDASAN BUATAN
Metode Pencarian Heuristik �Heuristik berasal dari bahasa Yunani yang berarti ‘mencari’ atau ‘menemukan’. �Heuristik dapat diartikan sebagai proses yang mungkin dapat menyelesaikan suatu asalah tetapi tidak ada jaminan bahwa solusi yang dicari selalu dapat di termukan. �Heurisitik suatu fungsi yang memberikan suatu nilai berupa biaya perkiraan (estimasi) dari suatu solusi
Generate and Test �Metode yang paling sederhana �Algoritma GT menggunakan prinsip dasar Depth First Search
Generate and Test Algorithm Generate a possible solution. For some problems, this means generating a particularpoint in the problem space. For others, it means generating a path from a start state. 2. Test to see if this is actually a solution by comparing the chosen point or endpoint of the chosen path to the set of acceptable goal states. 3. If a solution has been found, quit. Otherwise, return to step 1. 1.
Best First Search �Metode yang membangkitkan suksesor dengan mempertimbangkan harga (didapat dari fungsi heuristik tertentu) dari setiap node. �BFS memilih simpul baru yang memiliki biaya terkecil diantara semua leaf nodes (simpul – simpul pada level terdalam)
Best First Search
Algoritma Best-First Search 1. Start with OPEN containing just the initial state. 2. Until a goal is found or there are no nodes left on OPEN do: a) Pick the best node on OPEN. b) Generate its successors. c) For each successor do: i. If it has not been generated, evaluate it, add it to OPEN, and record its parent. ii. If it has been generated, change the parent if this new path is better than the previous one. In that case, update the cost of getting to this node and to any successors that this node may already have.
Greedy Best-First Search �Salah satu jenis algoritma Best-First Search yang paling sederhana dengn hanya memperhitungkan biaya perkiraan saja f(n) = h(n)
Contoh n M h(n) 70 S A B C D E 80 80 60 70 85 74 F G H J 70 0 40 100 K L 30 20
Greedy Best-First Search �Complete ? No, can get stuck in loops Complete if repeated-state checking is performed �Time ? O(bm), but good heuristic can give dramatic improvement �Space ? O(bm) – save all nodes in memory �Optimal ? No, Why ?
A* (A Bintang) �Algoritma BFS yang menggabungkan Uniform Cost Search dan Greedy Best-First Search. �Biaya yang diperhitungan = biaya sebenarnya + biaya perkiraan f(n) = g(n) + h(n)
�Iterative Deepning A* (IDA*) �Simplified Memory-Bounded A* �Bi-directioinal A* �Modified Bi-directional A* �Dynamic Weighting A* �Beam A*
- Slides: 12