Bab 3 Solving Problem by Searching

dokumen-dokumen yang mirip
Problem-solving Agent: Searching

IKI 30320: Sistem Cerdas Kuliah 3: Problem-Solving Agent & Search

Problem solving by Searching. Materi 3 Kecerdasan Buatan Oleh: Dewi Liliana TI PNJ

Bab 4. Informed Search

Tujuan Instruksional

Hal penting dalam menentukan keberhasilan sistem cerdas adalah kesuksesan dalam pencarian.

Algoritma Pencarian Blind. Breadth First Search Depth First Search

Overview. Searching. Deskripsi. Intro Searching 2/4/2012 IF-UTAMA 1

IKI30320 Kuliah 3 3 Sep Ruli Manurung. Problem solving agent. Representasi masalah: state space. Pencarian solusi: search.

IKI 30320: Sistem Cerdas Kuliah 4: Uninformed Search Strategies (Rev.)

Problem-Solving Agent & Search

IKI30320 Kuliah 4 5 Sep Ruli Manurung. Ulasan. Breadth-first. Uniform-cost. Depth-first. Pengulangan state. Ringkasan

AI sebagai Masalah Pelacakan. Lesson 2

Pemecahan Masalah dengan Metoda Pencarian (Searching)

ABSTRACT. Keyword: Algorithm, Depth First Search, Breadth First Search, backtracking, Maze, Rat Race, Web Peta. Universitas Kristen Maranatha

METODE PENCARIAN BFS dan DFS

Aplikasi dan Analisis Algoritma BFS dan DFS dalam Menemukan Solusi pada Kasus Water Jug

Penyelesaian Masalah dengan Pencarian

Kecerdasan Buatan. Penyelesaian Masalah dengan Pencarian... Pertemuan 02. Husni

PENERAPANAN ALGORITMA BFS, DFS, DAN UCS UNTUK MENCARI SOLUSI PADA MASALAH ROMANIA

Search Strategy. Search Strategy

Kecerdasan Buatan Penyelesaian Masalah dengan Pencarian

Metode Pencarian Terdapat banyak metode yang telah diusulkan. Semua metode yang ada dapat dibedakan ke dalam 2 jenis : 1. Pencarian buta / tanpa infor

Bab 2 2. Teknik Pencarian

Breadth/Depth First Search. Bahan Kuliah IF2211 Strategi Algoritmik Oleh: Rinaldi Munir Update: Masayu Leylia Khodra 22 September 2013

Penerapan Search Tree pada Penyelesaian Masalah Penentuan Jalur Kota Terpendek.

IKI30320 Kuliah 5 12 Sep Ruli Manurung. Best-first. search. Greedy best-first. search. search. Merancang heuristic

Sebelumnya... Best-First Search Greedy Search A* Search, karena boros memory, dimunculkan variannya (sekilas): IDA* SMA* D* (DWA*) RBFS Beam

Breadth/Depth First Search (BFS/DFS) Bahan Kuliah IF2211 Strategi Algoritmik Oleh: Rinaldi Munir Update: Nur Ulfa Maulidevi 2 Maret 2015

Informed search. Greedy Search A* Search IDA* Search RBFS Search SMA* Search

ALGORITMA PENCARIAN. 1. Iterative-Deepening Depth-First Search (IDS) Nama : Gede Noverdi Indra Wirawan Nim : Kelas : VI A

Informed Search (Heuristic) & Eksplorasinya

TIP 163. Game Engine. Topik 5 (Pert 6) Graf, Representasi Dunia, dan Algoritma Pencari Jalur (Pathfinding) Dosen: Aditya Wikan Mahastama

Ruang Pencarian PERTEMUAN 3

Pengembangan Teknik Pencarian Optimal Menggunakan Algoritma Generate and Test dengan Diagram Precedence (GTPRE)

METODE PENCARIAN. Irvanizam Zamanhuri, M.Sc Dr. Taufiq A. Gani, M.EngSc

Referensi. Materi kuliah IF3170 Inteligensi Buatan Teknik Informatika ITB,

Metode Searching. Blind/Un-informed Search. Heuristic/Informed Search. Breadth-First Search (BFS) Depth-First Search (DFS) Hill Climbing A*

SEARCHING SIMULATION SHORTEST ROUTE OF BUS TRANSPORTATION TRANS JAKARTA INDONESIA USING ITERATIVE DEEPENING ALGORITHM AND DJIKSTRA ALGORITHM

HTB (Hierarchical Token Bucket) Queue Tree-System Mikrotik user Meeting Jakarta, Indonesia(2016)

Bahasan Terakhir... Pencarian dan Klasifikasinya Breadth-first Search Depth-first Search Variasi Depth-first Search:

FREQUENT ITEMSET MINING MENGGUNAKAN ALGORITMA PIE

BAB III ANALISIS DAN PERANCANGAN SISTEM

PERBANDINGAN METODE PENCARIAN DEPTH-FIRST SEARCH, BREADTH-FIRST SEARCH DAN BEST-FIRST SEARCH PADA PERMAINAN 8-PUZZLE

Nama Soal Pembagian Ring Road Batas Waktu 1 detik Nama Berkas Ringroad[1..10].out Batas Memori 32 MB Tipe [output only] Sumber Brian Marshal

Simulasi Pencarian Rute Terpendek dengan Metode Algoritma A* (A-Star) Agus Gustriana ( )

Outline. Struktur Data & Algoritme (Data Structures & Algorithms) Pengantar. Definisi. 2-3 Trees

SEARCHING. Blind Search & Heuristic Search

Kasus Pelacakan untuk Pemilihan rute terpendek. Bagaimana Representasi Graph (start : Arad => tujuan:bucharest)???

Back end. Generate soal. logic. Generate plan. output. N-puzzle solved GUI. Parsing output dari solver

Praktikum Blind Search (BFS dan DFS)

Penyelesaian N-Puzzle Menggunakan A* dan Iterative Deepening A*

7. Analisis Kebutuhan - 1 (System Actors & System Use Cases )

Penerapan BFS dan DFS pada Pencarian Solusi

1/5. while and do Loops The remaining types of loops are while and do. As with for loops, while and do loops Praktikum Alpro Modul 3.

Artificial Intelegence/ P_2. Eka Yuniar

Review. Struktur Data & Algoritme (Data Structures & Algorithms) Objectives. Outline. Stacks & Queues

Pemrograman Lanjut. Interface

Penerapan BFS dan DFS pada Pencarian Solusi

MODIFIKASI METODE BACKTRACKING UNTUK MEMBANTU MENCARI PENYELESAIAN PERMAINAN PEG SOLITAIRE

Struktur Data & Algoritma

UJIAN AKHIR SEMESTER GANJIL 2005/2006 ALGORITMA & STRUKTUR DATA / CS2014

PENGUJIAN PERANGKAT LUNAK

Kecerdasan Buatan. Pertemuan 03. Pencarian Branch & Bound dan Heuristik (Informed)

Game Playing #1/5. (C) 2005, gunawan -

ANALISIS ALGORITMA BINARY SEARCH

ABSTRAK. Kata kunci: Artifficial Intelligence (AI), Finite State Machine (FSM), video game

Virtual Memory Ch. 9. Virtual Memory. SISTIM OPERASI (Operating System) IKI Johny Moningka

Rekursif. Proses yang memanggil dirinya sendiri. Merupakan suatu fungsi atau prosedur Terdapat suatu kondisi untuk berhenti.

TEKNIK PENYELESAIAN MASALAH BERDASARKAN AI

Outline. IKI 40931: Topik Khusus: NLP Kuliah 7: Parsing CFG. Parsing. Contoh parsing. Ruli Manurung. 10 Maret (Bab Jurafsky & Martin)

KI Kecerdasan Buatan Materi 5: Pencarian dengan Optimasi (Local Search & Optimization )

Sistem Kecerdasan Buatan. Masalah, Ruang Masalah dan Pencarian Solusi. Masalah. Masalah Sebagai Ruang Keadaan 10/7/2015

Pemrograman Web. Object Oriented Programming in PHP 5

Penerapan Metode Best First Search Pada Permainan Tic Tac Toe

BAB I PENDAHULUAN. Di tengah masyarakat dengan aktivitas yang tinggi, mobilitas menjadi hal yang penting.

TEORI BAHASA DAN AUTOMATA

Implementasi Algoritma BFS dan DFS dalam Penyelesaian Token Flip Puzzle

Mencari jalan keluar di dalam labirin (Maze Problem).

Isyarat. Oleh Risanuri Hidayat. Isyarat. Bernilai real, skalar Fungsi dari variabel waktu Nilai suatu isyarat pada waktu t harus real

LESSON 6 : INFORMED SEARCH Part II

PENYELESAIAN TRAVELLING SALESMAN PROBLEM DENGAN ALGORITMA BRANCH AND BOUND

ALGORITMA PENCARIAN (HEURISTIC)

KONTROL OTOMATIS PADA ROBOT PENGANTAR BARANG DENGAN PARAMETER MASUKAN JARAK DENGAN OBJEK DAN POSISI ROBOT. oleh. Ricky Jeconiah NIM :

Panduan Excel untuk Pelamar Kerja (Indonesian Edition)

ALGORITMA PENCARIAN (1)

METODE PENCARIAN DAN PELACAKAN

Pengantar Sistem Pakar

LINEAR PROGRAMMING-1

IKI30320 Kuliah 8 26 Sep Ruli Manurung. Game playing. Strategi optimal. Bekerja cepat Cutoff Tree pruning. State of the art.

ABSTRACT. Keywords: forecasting, forecasting method, production planning, and the strategy of production planning. Universitas Kristen Maranatha

ALGORITMA PENCARIAN SIMPUL SOLUSI DALAM GRAF

Jurusan Matematika Fakultas Matematika dan Ilmu Pengetahuan Alam Institut Teknologi Sepuluh Nopember Surabaya 2011

SSSS, Problem Solving. State Space Search. Erick Pranata. Edisi I

Membangun Menara karakter (Indonesian Edition)

IKI30320 Kuliah 19 3 Des Ruli Manurung. Learning. Agents. Inductive Learning. Decision Tree. Mengukur Kinerja Belajar.

Rahasia Cermat & Mahir Menguasai Akuntansi Keuangan Menengah (Indonesian Edition)

Transkripsi:

Bab 3 Solving Problem by Searching Problem Solving Agent Simple Reflex agents are unable to plan ahead Their action are determined only by current percept No knowledge of what their action nor what is the goal Typical tasks yang termasuk dalam simple reflex agents antara lain: Get to location x Lay out chip Clean rooms in house Solve puzzle Pada task diatas umumnya mendapatkan informasi tentang Goal yang harus dicapai dengan suatu preferences tertentu. Namun untuk mencapai Goal yang ditentukan, seringkali suatu agent harus melakukan suatu sequence action antara [immediate actions] yang harus dipilih dari berbagai alternatives yang ada. Pada kenyataannya, Agent tidak memiliki knowledge untuk menentukan alternative manakah yang terbaik. Pada situasi ini, suatu agent harus melalui suatu proses untuk menentukan sequence of actions mana yang terbaik untuk mencapai Goal yang ditentukan dan process ini disebut search. Before an agent can start searching for solution, it must formulate a goal and then use the goal to formulate the problem [problem formulation] 1. Goal formulation based on current situation, is the first step in problem solving. 2. Problem formulation is the process of deciding which actions and states to consider, and follows goal formulation. The environment of the problem is represented by a state space and a path through the state space from the initial state to a goal state is a solution. Secara general input dari suatu search adalah Goal, Utility yang dibutuhkan, states dan actions sedangkan outputnya adalah sequence of action (from current state, through other states) menuju goal. Problem umumnya didefinisikan, dalam 4 bagian penting yaitu: 1. An initial state 2. A set of operators 3. A goal test function 4. A path cost function. Problem Solving Agent adalah salah satu dari goal-based agent dan merupakan bentuk terbatas dari suatu general agent Problem yang dihadapi dapat dibedakan atas beberapa tipe problem [problem type] yaitu: 1. Deterministic, accessible merupakan single-state problem 2. Deterministic, inaccessible merupakan multi-state problem 3. Nondeterministic, inaccessible merupakan contingency problem 4. Unknown state space merupakan exploration problem (online) Contingency problem umumnya diselesaikan dengan bantuan sensors during eksekusi dan menghasilkan suatu tree solution atau suatu policy. Dalam pelaksanaannya proses penentuan solusi dilakukan secara interleave antara search dan eksekusi. [Lihat catatan tambahan di lampiran bab ini]

Saudara sedang berlibur di Romania, dan saat ini ada di kota Arad. Jadwal penerbangan saudara untuk pulang adalah besok dari kota Bucharest. Maka: Goal : Berada di Bucharest Problem : states : various cities Operators : drive between cities Solution : sequence of cities, misalnya Arad, Sibiu, Fagaras, Bucharest.

Penentuan state space Real world is absurdly complex state space must be abstracted for problem solving (Abstract) state = set of real states (Abstract) Operators = complex combination of real actions Misalnya: dari Arad Zerind represents a complex set of possible routes, detours, rest stops, dll. Untuk menjamin realizability, any real state in Arad must get to sama real state is Zerind. (Abstract) Solution = set of real paths that are solutions in the real world Remember: Setiap abstract action harus easier than original problem. Algoritma umum dari suatu general search adalah sbb: --------------------------------------------------------------------------------------------------------------------- function GENERAL-SEARCH (problem, QUEUING-FN) returns a solution or failure nodes MAKE-QUEUE( MAKE-NODE (INITIAL_STATE [problem])) loop do if nodes is empty then return failure // no candidates for expansion nodes REMOVE-FRONT(nodes) if GOAL-TEST[problem] applied to STATE(node) succeeds then return node else nodes QUEUING-FN(nodes, EXPAND(node, OPERATORS[problem])) // choose a leaf node for expansion depend on strategy end ---------------------------------------------------------------------------------------------------------------------- Basic idea dari suatu search algorithms adalah expanding states atau simulated exploration of state space by generating successors of already-explored states. Algoritma dari suatu simple problem solving agent dapat dilihat berikut ini: -------------------------------------------------------------------------------------------------------------- function SIMPLE_PROBLEM_SOLVING_AGENT (p) returns an action input: p, a percept static: a, an action sequence, innitially empty state, some description of current world state g, a goal, innitially null problem, a problem formulation state UPDATE_STATE (state, p) if a is empty then g FORMULATE_GOAL (state) problem FORMULATE_PROBLEM (state, g) a SEARCH (problem) action RECOMMENDATION (a, state) a REMAINDER (a, state) return action ------------------------------------------------------------------------------------------ Algoritma diatas dianggap sebagai suatu offline problem solving atau online problem solving yang melibatkan action tanpa complete knowledge dari problem dan kemungkinan solution yang ada.

Uniformed Search Strategies Uniformed search strategies use only the information available in the problem definition. This strategies is implemented in: Breadth First Search (BFS) Uniform Cost Search Depth First Search (DFS) Depth Limited Search Iterative Deepening Search Hal hal yang harus diperhatikan dalam implementasi suatu algoritma search antara lain: Suatu state adalah suatu representasi dari suatu physical configuration atau suatu snapshot of event, jadi states tidak memiliki parents, children, dept maupun path cost sedangkan suatu node adalah suatu data struktur yang merupakan bagian dari suatu search tree termasuk parent node, children nodes yang memiliki depth dan path cost tertentu. Fungsi EXPAND akan meng create suatu new nodes, dan dengan menggunakan OPERATORS atau SUCCESSORFn dari problem untuk meng create state yang berkaitan. Search strategy pada dasarnya ditentukan oleh cara pemilihan urutan node yang akan di expand, dan keberhasilan strategy tersebut dievaluasi berdasarkan 4 kriteria berikut ini: 1. Completeness, apakah strategy tersebut selalu menemukan solusi jika solusinya ada? 2. time complexity, ditentukan berdasarkan jumlah node yang di generate dan di expand untuk memperoleh solusi 3. space complexity, yaitu jumlah maksimum nodes yang disimpan di memory selama proses pencarian solusi 4. optimality, apakah strategy tersebut selalu mendapatkan solusi yang terbaik atau least-cost solution Time and space complexity diukur berdasarkan besaran: 1. b = maksimum branching factor dari search tree 2. d = depth dari least cost solution 3. m = maksimum depth dari state space ( dapat bernilai tak terhingga). Untuk ke lima metoda Uninformed search strategies diatas kita mengambil contoh soal Romania diatas dimana jarak antar kota dapat dilihat pada tabel

Breadth First Search (BFS) Expand shallowest unexpanded node Space needed is the big problem in BFS Implementation: QUEUING-FN = put successors at the end of the queue. Karakteristik dari BFS: Complete Time Space Optimal : Yes (if branching factor of the tree b is finite) : 1 + b + b 2 + b 3 + + b d (exponential in d.) : O (b d ) because we keep every node in memory. : Yes (if cost = 1 per step but not optimal in general) Space akan menjadi big problem pada BFS, bayangkan saudara akan membutuhkan memory sebesar 86 Gbyte untuk 24 jam proses dengan kecepatan 1 Mbyte/det

Uniform Cost Search Pada Uniform Cost Search kita akan expand Least-cost unexpanded node. Implementation: QUEUING-FN = insert in order of increasing path cost. Karakteristik dari Uniform Cost Search Complete : Yes (if step cost.) Time : # of nodes with g cost of optimal solution ) Space : # of nodes with g cost of optimal solution ) Optimal : Yes Depth First Search (DFS) DFS always expands one of the nodes at the deepest level of the tree Implementation: QUEUING-FN = insert the successors in front of the queue DFS can perform infinite cyclic excursions so, DFS need a finite, non-cyclic search space Or repeated state checking Only when the search hits a dead end ( a non-goal node with no expansion), go back and expand nodes at shallower level DFS can be implemented by general search with queuing function that always put the newly generated states in front of the queue. (QUEUING-FN = insert the successors in front of the queue) The memory requirement is O(bm) where b is branching factor and m = maximum depth because DFS only needs storage for bm nodes. Time complexity is O(b m ), so DFS usually faster than BFS The drawback of DFS, it can get stuck going down the wrong path (problem for deep and infinite search tree) and it can be infinite loop

Depth limited Search Depth Limited Search is used to avoid the problem in DFS by imposing a cutoff on the maximum depth of a path. The cutoff can be implemented using: A special depth limited search algorithm. A general search algorithm with operator that keep track of the depth. Note: There are 20 cities on the map of Romania. So if there is a solution, the longest search length is 19. The depth cut of operator is if you are in city A, and have traveled a path less than 19 steps, then generate a new state with a path length that is one greater. It is guarantee to get the solution (if one exist) but not the shortest path solution). Iterative Deepening Sama dengan Depth Limited search hanya depth d secara iterative bertambah mulai dari d = 1 sampai maksimum

Contoh soal Dari gambar dibawah ini, S adalah start state dan G adalah Goal state Ketika meletakan child nodes hasil ekspansi suatu node, maka child node diletakkan menurut alphabetical order, misalkan pula kita tidak pernah men generate child nodes yang pernah menjadi ancestors dari current node pada search tree. Maka: urutan BFS dalam meng expand node adalah S A B B D A C E C E E G urutan DFS dalam meng expand node adalah S A B C H E D G urutan Iterative Deepening dalam meng expand node adalah S S A B S A B D G Note that when we are searching with a depth limit of d we do not expand nodes at that level but we do test them to see if they are goal states. For example, the diagram below shows the search tree on the third iteration (depth limit = 3). For this tree we expand nodes S A B D. Nodes C, E, E and G are tested to see if they are goal states but they are not expanded. Alternatively, if we consider nodes at the depth limit as \expanded" (i.e. in the above example C, E, and G) then our solution is: S A B S A B D B A C E S A B C E D E G