Chapter 6: Q16E (page 194)
The garage sale problem (courtesy of Professor Lofti Zadeh). On a given Sunday morning, there are n garage sales going on, . For each garage sale , you have an estimate of its value to you, . For any two garage sales you have an estimate of the transportation cost of getting from to . You are also given the costs and of going between your home and each garage sale. You want to find a tour of a subset of the given garage sales, starting and ending at home, that maximizes your total benefit minus your total transportation costs. Give an algorithm that solves this problem in time .
(Hint: This is closely related to the traveling salesman problem.)
Short Answer
This problem is identical to that of Traveling salesman problem where need to add one variant to it, that is to find relevant benefit by computing optimal distance. This problem is solved by dynamic programming approach.