3

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

TimeToCodeTheRoad
  • 7,032
  • 16
  • 57
  • 70
  • http://cstheory.stackexchange.com/ might be a better place to ask this. – Tom Anderson Jan 27 '12 at 17:34
  • @TomAnderson: cstheory is for research-level questions. I doubt this is one. – blubb Jan 27 '12 at 17:44
  • Also, i note that in the question, the work limit and overtime rate are described in terms of hours, but the lengths are described in terms of metres. Oh, and the limit is 20 hours a day - i guess bus drivers work pretty hard in Bangladesh! – Tom Anderson Jan 27 '12 at 17:54
  • @blubb: a quick look at the questions there suggests that that may be the ideal, but that it is not absolutely rigorously adhered to. If the question was suitably rephrased, perhaps it would be appropriate there. It doesn't seem likely to get useful answers here. – Tom Anderson Jan 27 '12 at 17:57

1 Answers1

1

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

Nemo
  • 70,042
  • 10
  • 116
  • 153