Giải quyết vấn đề bằng tìm kiếm (TRÍ TUỆ NHÂN tạo SLIDE)

37 32 0
Giải quyết vấn đề bằng tìm kiếm (TRÍ TUỆ NHÂN tạo SLIDE)

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TÀI LIỆU TRẮC NGHIỆM, BÀI GIẢNG PPT CÁC MÔN CHUYÊN NGÀNH Y DƯỢC VÀ CÁC NGÀNH KHÁC HAY NHẤT CÓ TẠI “TÀI LIỆU NGÀNH Y DƯỢC HAY NHẤT” ;https:123doc.netusershomeuser_home.php?use_id=7046916. TÀI LIỆU Giải quyết vấn đề bằng tìm kiếm (TRÍ TUỆ NHÂN TẠO SLIDE). DÀNH CHO SINH VIÊN CÁC TRƯỜNG ĐẠI HỌC CHUYÊN NGÀNH CÔNG NGHỆ KỸ THUẬT, Y DƯỢC VÀ CÁC NGÀNH KHÁC, GIÚP SINH VIÊN HỆ THỐNG, ÔN TẬP VÀ HỌC TỐT KHI HỌC TÀI LIỆU Giải quyết vấn đề bằng tìm kiếm (TRÍ TUỆ NHÂN TẠO SLIDE)

Mơn học: Trí tuệ nhân tạo Chương 3: Giải vấn đề tìm kiếm Phần 2: Tìm kiếm có thông tin (informed search) Khoa Công nghệ Thông tin Nội dung I Giới thiệu II Greedy best-first search III A* search IV Other search strategy 3/29/21 Giới thiệu • Informed searches: Sử dụng kiến thức/thông tin lĩnh vực xử lý để hướng dẫn lựa chọn cách tìm kiếm giải pháp tốt • Cịn gọi heuristic Search, 3/29/21 Giới thiệu • Nhóm thuật tốn nghiên cứu phần bestfirst search Sử dụng hàm f(n) (evaluation function, hay heuristic function) để tính chi phí thấp node n • Ý tưởng: node chọn dựa giá trị hàm f(n) – estimate of "desirability" (mức độ thỏa mãn) Chọn node chưa chọn có mức độ thỏa mãn cao • Hai thuật toán phổ biến: - greedy best-first search - A* search 3/29/21 Giới thiệu • Định nghĩa hàm: heuristic function, h(n): – uses domain-specific information in some way – is computable from the current state description – it estimates: • the "goodness" of node n • how close node n is to a goal • the cost of minimal cost path from node n to a goal state h(n) >= required for all nodes n h(n) = implies n is a goal node h(n) = infinity implies n is a dead end from which a goal cannot be reached 3/29/21 Nội dung I Giới thiệu II Greedy best-first search III A* search IV Other search strategy 3/29/21 II Greedy best-first search • Là chiến lược tìm kiếm best-first đơn giản • Hàm Evaluation function f(n) = h(n) (heuristic) dùng hàm: – Ước lượng chi phí thấp từ node n đến node mục tiêu • Greedy best-first search sau bước chọn node mà gần với node mục tiêu Không cho phép chọn node không nằm solution path (nên gọi tham lam) 3/29/21 Ví dụ: Romania with step costs in km 3/29/21 Ví dụ Dùng thuật tốn greedy best-first search để tìm đường từ Arab đến Bucharest The initial state=Arad H àm h (n ): kh oả ả n g cách đ i th ẳả n g từ n od e n đ ếế n m ụ c tiếu 3/29/21 Greedy best-first search example • The first expansion step produces: – Sibiu, Timisoara and Zerind • Greedy best-first will select Sibiu 3/29/21 10 Bài tập 3/29/21 23 A* search, evaluation • Completeness: YES – Since bands of increasing f are added – Unless there are infinitly many nodes with fC* 24 Nội dung I Giới thiệu II Greedy best-first search III A* search IV Other search strategy 3/29/21 25 Memory-bounded heuristic search Some solutions to A* space problems (maintain completeness and optimality) • Iterative-deepening A* (IDA*) – Here cutoff information is the f-cost (g+h) instead of depth • Recursive best-first search(RBFS) – Recursive algorithm that attempts to mimic standard bestfirst search with linear space • (Simple) Memory-bounded A* ((S)MA*) – Drop the worst-leaf node when memory is full 3/29/21 26 (Simplified) Memory-Bounded A* • Use all available memory – I.e expand best leafs until available memory is full – When full, SMA* drops worst leaf node (highest f-value) – Like RFBS backup forgotten node to its parent • What if all leafs have the same f-value? – Same node could be selected for expansion and deletion – SMA* solves this by expanding newest best leaf and deleting oldest worst leaf • SMA* is complete if solution is reachable, optimal if optimal solution is reachable 3/29/21 33 Learning to search better • All previous algorithms use fixed strategies • Agents can learn to improve their search by exploiting the meta-level state space – Each meta-level state is a internal (computational) state of a program that is searching in the object-level state space – In A* such a state consists of the current search tree • A meta-level learning algorithm from experiences at the meta-level 3/29/21 34 Invent Heuristic functions • E.g for the 8-puzzle – Avg solution cost is about 22 steps (branching factor +/- 3) – Exhaustive search to depth 22: 3.1 x 1010 states – A good heuristic function can reduce the search process 3/29/21 35 Heuristic functions • E.g for the 8-puzzle knows two commonly used heuristics • h1 = the number of misplaced tiles – h1(s)=8 • h2 = the sum of the distances of the tiles from their goal positions (manhattan distance) – h2(s)=3+1+2+2+2+3+3+2=18 3/29/21 36 Heuristic quality • Effective branching factor b* – Is the branching factor that a uniform tree of depth d would have in order to contain N+1 nodes N + = + b* + (b*)2 + … + (b*)d • Measure is fairly constant for sufficiently hard problems – Can thus provide a good guide to the heuristic’s overall usefulness – A good value of b* is 3/29/21 37 Heuristic quality and dominance • Typical search costs (average number of nodes expanded) • If h2(n) ≥ h1(n) for all n (both admissible) then h2 dominates h1 and h2 is better for search • Given any admissible heuristics ha(n), hb(n) h(n) = max(ha(n), hb(n)) is also admissible and dominates ha, hb 3/29/21 38 Admissible heuristics - Relaxed problem • A problem with fewer restrictions on the actions is called a relaxed problem • The cost of an optimal solution to a relaxed problem is an admissible heuristic for the original problem: – Relaxed 8-puzzle for h1 : a tile can move anywhere As a result, h1(n) gives the shortest solution – Relaxed 8-puzzle for h2 : a tile can move to any adjacent square As a result, h2(n) gives the shortest solution • The optimal solution cost of a relaxed problem is no greater than the optimal solution cost of the real problem 3/29/21 39 Click to edit Relaxed problems Master(con’t) title style • Well-known example: Travelling Salesperson Problem (TSP) • Find the shortest tour visiting all cities exactly once • Minimum spanning tree can be computed in O(n2) • and is a lower bound on the shortest (open) tour 3/29/21 40 Inventing admissible heuristics • Admissible heuristics can also be derived from the solution cost of a subproblem of a given problem • This cost is a lower bound on the cost of the real problem • Pattern databases store the exact solution to for every possible subproblem instance – The complete heuristic is constructed using the patterns in the DB 3/29/21 41 Inventing admissible heuristics • Another way to find an admissible heuristic is through learning from experience: – Experience = solving lots of 8-puzzles – An inductive learning algorithm can be used to predict costs for other states that arise during search 3/29/21 42 Summary • Heuristic functions estimate costs of shortest paths • Good heuristics can dramatically reduce search cost • Greedy best-first search expands lowest h – incomplete and not always optimal • A* search expands lowest g + h – complete and optimal – also optimally eficient (up to tie-breaks, for forward search) • Admissible heuristics can be derived from exact solution of relaxed problems 3/29/21 43 ... • Informed searches: Sử dụng kiến thức/thông tin lĩnh vực xử lý để hướng dẫn lựa chọn cách tìm kiếm giải pháp tốt • Cịn gọi heuristic Search, 3/29/21 Giới thiệu • Nhóm thuật tốn nghiên cứu phần... If Fagaras is expanded we get: – Sibiu and Bucharest • Goal reached !! – Chi phí tìm kiếm thấp khơng đạt lời giải tối ưu: – Yet not optimal (see Arad, Sibiu, Rimnicu Vilcea, Pitesti) 3/29/21... search III A* search IV Other search strategy 3/29/21 II Greedy best-first search • Là chiến lược tìm kiếm best-first đơn giản • Hàm Evaluation function f(n) = h(n) (heuristic) dùng hàm: – Ước lượng

Ngày đăng: 29/03/2021, 16:04

Từ khóa liên quan

Mục lục

  • Slide 1

  • Nội dung

  • Giới thiệu

  • Giới thiệu

  • Giới thiệu

  • Nội dung

  • II. Greedy best-first search

  • Ví dụ: Romania with step costs in km

  • Ví dụ

  • Greedy best-first search example

  • Greedy best-first search example

  • Greedy best-first search example

  • Bài tập

  • Properties of greedy best-first search

  • Nội dung

  • III. A* search

  • A* search example

  • A* search example

  • A* search example

  • A* search example

Tài liệu cùng người dùng

Tài liệu liên quan