Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DateScheduler(S)
- set A := ∅
- set C := ∅
- choose event x from S that starts the earliest (In case of tie breakers, choose the one with the longer range)
- remove x from S and place into C
- while S ≠ ∅ do
- find all elements y within S that share common days in their respective date ranges with the one element in C, place them in C
- from the elements in C, find the combination of the most elements that add up their cost values to <= B
- select the earliest common date between the combination above and one that does not conflict with any existing dates in A, and place that date in A
- remove from S, all elements in B, then clear B
- choose event x from S that starts the earliest (In case of tie breakers, choose the one with the longer range)
- remove x from S and place into C
- endwhile
- return A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement