Presentation is loading. Please wait.

Presentation is loading. Please wait.

08.10.09IT 60101: Lecture #201 Foundation of Computing Systems Lecture 20 Classic Optimization Problems.

Similar presentations


Presentation on theme: "08.10.09IT 60101: Lecture #201 Foundation of Computing Systems Lecture 20 Classic Optimization Problems."— Presentation transcript:

1 08.10.09IT 60101: Lecture #201 Foundation of Computing Systems Lecture 20 Classic Optimization Problems

2 08.10.09IT 60101: Lecture #202 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

3 08.10.09IT 60101: Lecture #203 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

4 08.10.09IT 60101: Lecture #204 Coin Changing Problem =

5 08.10.09IT 60101: Lecture #205 Coin Changing Problem Problem Definition Given a set of denomination of the coins, say c 1, c 2, c 3, …, c n, such that c 1 > c 2 > c 3 > …> c n = 1. Given an amount A, the problem is to determine the minimum number of coins needed to make A in change. Note that The problem may assume c n =1, so that it is always possible to make change for any amount A. Any number of coins for each denomination is available.

6 08.10.09IT 60101: Lecture #206 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

7 08.10.09IT 60101: Lecture #207 Optimal Retrieval Problem 

8 08.10.09IT 60101: Lecture #208 Optimal Retrieval Problem Problem Definition Suppose, that n programs having length l 1, l 2, …, l n are stored on a tape. If the programs are stored in the order l i1, l i2, …, l in, the time to retrieve any program i k is (We assume that retrieval time starts at the beginning of the tape. The above retrieval time for a program i k results from the fact that in order to retrieve program i k, we must pass all of the programs stored before program i k ). The average retrieval time is defined as The problem is to find an ordering of the program to minimize the average retrieval time.

9 08.10.09IT 60101: Lecture #209 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

10 08.10.09IT 60101: Lecture #2010 Traveling Salesman Problem

11 08.10.09IT 60101: Lecture #2011 Traveling Salesman Problem Problem definition A salesman has a list of cities, each of which he must visit exactly once. There are direct roads between each pair of cities on the list. The problem is to find route the salesman should follow so that he travels the shortest possible distance on a round trip, starting at any one of the cities and then returning there. He should not travel a city twice except the starting city.

12 08.10.09IT 60101: Lecture #2012 Different Versions of Traveling Salesman Problems Hamiltonian Cycle Problem This problem is to find Hamiltonian cycle with minimum weight graph in graph theory and stated as below. Given an connected weighted graph and it is required to find a tour (a cycle through all the vertices exactly once except the first ) of minimum weight. Euclidian Traveling Salesman Problem This problem is to determine the shortest path closed tour that connects a given set of n-points on a plane. Bitonic Tour Problem A tour starts at the left most point, go strictly left to right, and then go strictly right to left and finally back to the starting point. The objective function and constraint is same as in the Traveling Salesman Problem.

13 08.10.09IT 60101: Lecture #2013 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

14 08.10.09IT 60101: Lecture #2014 Knapsack Problem

15 08.10.09IT 60101: Lecture #2015 Knapsack Problem The knapsack problem can be posed as follows. –A thief robbing a store finds n items: the i-th item is worth v i and weight w i. The thief would take as valuable as possible but he can carry at most W weights in his knapsack. Which items should the thief take?

16 08.10.09IT 60101: Lecture #2016 Knapsack Problems The knapsack problem can be generalized and formally stated as follows. Given n items and a knapsack. The knapsack has a capacity W. Any item say i, has a weight w i and a value v i per unit. If a quantity x i of the item i is placed into the knapsack, then a profit v i.x i is earned. The objective is to obtain a filling of the knapsack that maximizes the total profit earned. Since the knapsack capacity is W, we require the total weight of all chosen object to be at most W. Formally the problem may be stated as follows. Maximize Subject to

17 08.10.09IT 60101: Lecture #2017 Different Versions Knapsack Problems Discrete Knapsack Problem Here, all v i ’s, w i ’s and W are integers and each item must be taken or left behind. This problem is also called “integer” knapsack, and “0-1” knapsack problem Continuous Knapsack Problem In this version of the knapsack problem, we can take any quantity (i.e. a fraction) of each item (rather that having to make a binary (0 or 1) choice for each item.) Note: You can think 0-1 knapsack problem as being like a gold ingot while an item in continuous problem is more like gold dust.

18 08.10.09IT 60101: Lecture #2018 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

19 08.10.09IT 60101: Lecture #2019 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

20 08.10.09IT 60101: Lecture #2020 Bin Packing Problem

21 08.10.09IT 60101: Lecture #2021 Bin Packing Problem Problem definition Given n items of sizes s 1, s 2, …, s n. All sizes satisfy 0<s i ≤1. The problem is to pack these items in the fewest number of bins, given that each bin has unit capacity.


Download ppt "08.10.09IT 60101: Lecture #201 Foundation of Computing Systems Lecture 20 Classic Optimization Problems."

Similar presentations


Ads by Google