Search code examples
algorithmgreedy

The Bus Driver : uva 11389


The problem is here: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2384

I managed to solve this problem using a greedy approach. I sorted the morning routes in descending order, and the evening routes in ascending order, then I put the maximum from the morning route with the minimum in the evening route. This solution was accepted. I am trying to prove that the problem has greedy choice property, that is, the greedy choice is the part of an optimal solution. Can somebody help with the proof. I am doing this proof solely for practice


Solution

  • http://mathcentral.uregina.ca/mp/archives/previous2003/nov03sol.html