Find an optimal solution to a linear program in O(nlogn)
Raiden Barr
Answered question
2022-10-23
Find an optimal solution to a linear program in O(nlogn) Given and , design an algorithm which, in O(nlogn) operations, computes the optimal solution x∗ to the following linear program :
You may assume that a set of n real numbers can be sorted in time O(nlogn) and that each arithmetic operation takes constant time. I tried multiple things without much success. 1. Start with a feasible solution, for example and add to each coordination at each of the k iterations until the constraints aren't satisfied anymore. I'm not sure this solution would be in O(nlogn). 2. Compute the dual of the LP, we know by strong duality that the objective value of the optimal solution of the dual is equal to the objective value of the optimal solution of the primal. However I'm not sure how solving the dual would be any easier. 3. Lastly I tried to see if the simplex method combined with an adequate sorting would work but the simplex algorithm is in polynomial time.
Answer & Explanation
Immanuel Brennan
Beginner2022-10-24Added 9 answers
Step 1 Think of it this way. Each unit of has a benefit and a cost , and you have a total budget of . Step 2 You should buy as much as possible of the 's with the highest values of .
ndevunidt
Beginner2022-10-25Added 5 answers
Step 1 If you assume not merely that , but that y∗ is also the optimal solution (which must exist, because the objective function is continuous, and the set of feasible points is compact) you can get your contradiction by showing that the value of the objective can be improved by modifying y∗ . Taking your , for instance, with , we must have , and therefore for some (because . So now, if we decrease by , and increase by , where , then all the constraints will still be satisfied, and the objective function will increase by , which is positive, from the way are ordered, and this contradicts the supposed optimality of y∗ . Step 2 There's still a good deal of i-dotting and t-crossing necessary to complete the proof, and it's probably easier to prove it by showing that the dual:
has a feasible solution:
with , which implies that both and x∗ are optimal for their respective programs.