1 / 23

Heuristic Search

Heuristic Search. Best First Search. BEST FIRST SEARCH. Merupakan kombinasi kelebihan teknik depth first search dan breadth first search

Download Presentation

Heuristic Search

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Heuristic Search Best First Search

  2. BEST FIRST SEARCH • Merupakankombinasikelebihanteknikdepth first searchdanbreadth first search • Pencariandiperkenankanmengunjungi node yang adadi level yglebihrendahjikaternyata node pada level yglebihtinggiternyatamemilikinilaiheuristikygburuk

  3. Best First Search • Best First Search akanmembangkitkan node berikutnyadarisemua node ygpernahdibangkitkan • Pertanyaannya : Bagaimanamenentukansebuah node terbaiksaatini? Dilakukandenganmenggunakanbiayaperkiraan Bagaimanacaranyamenentukanbiayaperkiraan? Biayaperkiraandapatditentukandenganfungsi heuristic

  4. FUNGSI HEURISTIC • Suatufungsi heuristic dikatakanbaikjikabisamemberikanbiayaperkiraan yang mendekatibiayasebenarnya. • Semakinmendekatibiayasebenarnya, fungsi heuristic tersebutsemakinbaik.

  5. Contoh 100 16 10 A B C D ( 20 , 10 ) ( 35 , 10 ) ( 55 , 10 ) ( 65 , 10 ) Dalamkasuspencarianruteterpendek, biayasebenarnyaadalahpanjangjalan Raya yang sebenarnya. Sedangkanfungsiheuristiknyaadalahgarislurusdari 1 kotakekotalainnya. Untukitu,bisadigunakanrumusberikut : dAB = 15 dab = ( yb – ya )2 + ( xb – xa )2 dBC = 20 dCD = 10

  6. Algoritma Best First Search • Greedy Best First Search • Algoritma A*

  7. Greedy Best First Search • Algoritmainimerupakanjenisalgoritma Best First Search yg paling sederhana • Algoritmainihanyamemperhitungkanbiayaperkiraansaja f(n) = h’(n) • Karenahanyamemperhitungkanbiayaperkiraan yang belumtentukebenarannya, makaalgoritmainimenjaditidak optimal

  8. Contoh 90 A F 10 10 40 5 25 K 50 B 30 S 30 G 40 C 35 10 40 25 H 25 D 15 L E 52 80 20 J 40 M

  9. Langkah 1 A 10 25 B S 30 C 35 10 D E

  10. Langkah 2 A F 10 5 25 K 50 B S 30 C 35 10 D E

  11. Langkah 3 A F 10 5 25 K 50 B S 30 30 G C 35 10 D E

  12. SOLUSI A F 10 5 25 K 50 B S 30 30 G C 35 10 D S - B - K - G E Dengan Total Jarak = 105

  13. PENJELASAN • Dari contohdiatas, Greedy akanmenemukansolusiS-B-K-Gdengan total jarak105 • Padahaladasolusi lain yglebih optimal, yakni S-A-B-F-K-G dengan total jarakhanya95 • Dari situ bisadisimpulkanbahwa Greedy Best First Search tidakbisamenemukansolusi yang optimal

  14. Algoritma A* • Berbeda dg Greedy, algoritmainiakanmenghitungfungsi heuristic dengancaramenambahkanbiayasebenarnyadenganbiayaperkiraan. Sehinggadidapatkanrumus : f(n) = g(n) + h’(n) g(n) = Biayasebenarnyadari Node Awalke Node n h’(n) = Biayaperkiraandari Node n ke Node Tujuan

  15. Contoh 90 A F 10 10 40 5 25 K 50 B 30 S 30 G 40 C 35 10 40 25 H 25 D 15 L E 52 80 20 J 40 M

  16. Langkah 1 A 10 25 B S 30 C 35 10 D E

  17. Langkah 2 A 10 25 B S 30 C 35 10 D 15 E 20 J

  18. Langkah 3 A F 10 10 5 25 K 50 B S 30 C 35 10 D 15 E 20 J

  19. Langkah 4 90 A F 10 10 5 25 K 50 B S 30 G C 35 10 D 15 E 20 J

  20. Langkah 5 90 A F 10 10 40 5 25 K 50 B S 30 G C 35 10 D 15 E 20 J

  21. Langkah 6 90 A F 10 10 40 5 25 K 50 B 30 S 30 G C 35 10 D 15 E 20 J

  22. Solusi 90 A F 10 10 40 5 25 K 50 B 30 S 30 G C 35 10 D 15 S - A - B - F - K - G E 20 J Dengan Total Jarak = 95

  23. Kesimpulan • Algoritma A* lebihbaikdalammelakukanpencarian heuristic daripada Greedy Best First Search karenadapatmengasilkansolusi yang optimal

More Related