|
MrMoo posted:Check it out: https://is.gd/OMjCsI Is it supposed to return the high-water-mark for total cost of running jobs at any time during the schedule? Because it doesn't do that. Try with two jobs: the first that starts at 1, ends at 2, and has cost 100; the second that starts at 3 and ends at 4, and has cost 1. The algorithm you posted will return 1.
|
# ¿ Aug 13, 2016 02:35 |
|
|
# ¿ May 12, 2024 06:39 |
|
MrMoo posted:Yes, I have three very bad options so far and they're not really getting better. The idea with this version is to walk through a sorted list of time events and increment the cost as each job starts and decrement as they end. Your "max_cost" variable should actually be called "current_total_cost", if that helps. Once you have that, maximizing should be easy.
|
# ¿ Aug 13, 2016 02:39 |