TAILIEUCHUNG - Thuật toán Algorithms (Phần 50)

Tham khảo tài liệu 'thuật toán algorithms (phần 50)', khoa học tự nhiên, toán học phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 37. Dynamic Programming The principle of divide-and-conquer has guided the design of many of the algorithms we ve studied to solve a large problem break it up into smaller problems which can be solved independently. In dynamic programming this principle is carried to an extreme when we don t know exactly which smaller problems to solve we simply solve them all then store the answers away to be used later in solving larger problems. There are two principal difficulties with the application of this technique. First it may not always be possible to combine the solutions of two problems to form the solution of a larger one. Second there may be an unacceptably large number of small problems to solve. No one has precisely characterized which problems can be effectively solved with dynamic programming there are certainly many hard problems for which it does not seem to be applicable see Chapters 39 and 40 as well as many easy problems for which it is less efficient than standard algorithms. However there is a certain class of problems for which dynamic programming is quite effective. We ll see several examples in this section. These problems involve looking for the best way to do something and they have the general property that any decision involved in finding the best way to do a small subproblem remains a good decision even when that subproblem is included as a piece of some larger problem. Knapsack Problem Suppose that a thief robbing a safe finds N items of varying size and value that he could steal but has only a small knapsack of capacity A4 which he can use to carry the goods. The knapsack problem is to find the combination of items which the thief should choose for his knapsack in order to maximize the total take. For example suppose that he has a knapsack of capacity 17 and the safe contains many items of each of the following sizes and values 483 484 CHAPTER 37 name A B C D E size 3 4 7 8 9 value 4 5 10 11 13 As before we use single letter names for the items .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.