0

I have a scheduling scenario in which every time period has a cost. I need to select the time periods which will give me the least cost over a period of 24 hours. See below for an example of the dataset.

Start time | End time | Cost

  • 00:00 | 01:00 | $30
  • 01:00 | 05:00 | $50
  • 02:00 | 08:00 | $70
  • 04:00 | 12:00 | $100
  • 08:00 | 11:00 | $60
  • 10:00 | 14:00 | $50
  • 13:00 | 17:00 | $90
  • 13:00 | 20:00 | $120
  • 16:00 | 23:00 | $80
  • 18:00 | 22:00 | $60
  • 19:00 | 20:00 | $50
  • 21:00 | 23:00 | $20

Is there any Python software or library which I can use to derive the set of time periods which gives the least cost, each time period must not overlap and they must all add up to 24 hours?

  • The example has no solution. The first choice has to be option 1, the second choice has to be option 2, and there's no option that starts when option 2 begins. – Kodiologist Jun 12 at 13:55
  • Do they have to add up to 24 hours, or do they have to collectively cover a single unbroken 24-hour period? – BrenBarn Jun 14 at 2:15
  • They have to collectively cover a single unbroken 24-hour period. Gaps are allowed. – Xanlamin Jun 15 at 4:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.