Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Commuting to optimize profit Suppose you run a company with two offices, one in Washington and the other in San Francisco Each week, you must
Commuting to optimize profit Suppose you run a company with two offices, one in Washington and the other in San Francisco Each week, you must choose where to work, and your choice will ailect your pront: in week i, you will make DCi dollars if you work in Washington or SFi dollars if you work in San Francisco. While you clearly would like to work in the location with the higher profit, each flight from Washington to San Francisco (or vice versa) costs S1000. Given lists (DC1,... , DCn) and (SF1,... , SFn), your goal is to find a schedule that maximizes your total profit, taking transportation costs into account. Since you live in Washington, your schedule must start and end there (a) An obvious greedy strategy is to always work in the office with the higher profit. Give a (minimal) example showing that this strategy is not always optimal (b) Design a polynomial-time algorithm that finds the maximum total profit. Justify your algorithm's correctness and establish its running time. To get full credit for your solution, you should make your running time as small as possible
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started