Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. DateScheduler(S)
  2. set A := ∅
  3. set C := ∅
  4. choose event x from S that starts the earliest (In case of tie breakers, choose the one with the longer range)
  5. remove x from S and place into C
  6. while S ≠ ∅ do
  7. 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
  8. from the elements in C, find the combination of the most elements that add up their cost values to <= B
  9. 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
  10. remove from S, all elements in B, then clear B
  11. choose event x from S that starts the earliest (In case of tie breakers, choose the one with the longer range)
  12. remove x from S and place into C
  13. endwhile
  14. return A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement