#Is this algorithm Greedy or Dynamic Programming paradigm?

1 messages · Page 1 of 1 (latest)

azure bear
#

There is a set of schedules but with points. We want to maximize the points for each schedule. The high level description of the algorithm is that at every iteration of a loop we add the schedule with the highest points then next loop we add the schedule with the next highest point that does not conflict with earlier schedules. Is this greedy?

south fulcrumBOT
#

<@&987246717831381062> please have a look, thanks.

south fulcrumBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

muted wadi
#

what do you think? ^^

azure bear
#

It is greedy (the algorithm description in the OP), but there is a DP solution

muted wadi
#

yup, it sounds greedy from your description

#

obviously i don't have the specific problem in front of me

#

but it seems like you are solving the local maximum at each step, not caring about the optimal solution

#

so you are satisfied with "good enough" greedy solution

#

quite possible it can be solved optimally tho