Link to home
Start Free TrialLog in
Avatar of clintnash
clintnashFlag for United States of America

asked on

Need to sort list into time slots

I have a list of items which need to be sorted into time slots but that have limitations on the slots they can be in.  For example I have slots available all day monday but item 1 - cant be scheduled from 8:00am to 12:00pm so it needs to be sorted after 1:00.  I have spent the day trying to figure out where to start with this.  There will always be enough slots for the items, I just need an algorithm to sort them.  Any advice on where to start would be appreciated.

Thank you.
Avatar of d-glitch
d-glitch
Flag of United States of America image

What language or application are you using?  Are you doing this by hand?
What formats are required for your input and output data?

What are the criteria for an acceptable or optimal solution?  Spread things out as evenly as possible?  Or get things done as soon as possible?

Probably the easiest thing to do, is handle the items with the most constraints first.
Avatar of clintnash

ASKER

The current project is in VB.NET in a WPF application, but c# is fine as well. Currently its done by hand, trying to automate this.  Closest analogy is a calendar with 1 hour appointments (open calendar and a list of appointments to drop in).   Some (not all) appointments have constraints such as cant be during a particular time block.  My initial approach was to weight the items  and then sort them in "highest weight in first" but it doesn't seem to give me the optimum solution...leaves a lot that can't be scheduled.  So I changed directions and the current iteration is to flag each row with timeslots it could be in but this is worse than the first try....
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you...