Hi RobPratt, I ran your whole code and it gives me the following table. Should I get rid of any part of your code? Thanks.
| COURSE | ROOM_NO | ROOM_CAPACITY | ROOM_LOAD | NEW_ROOM_LOAD | Room_Status |
| CHEM101 | C101 | 20 | 7 | 20 | Available |
| CHEM101 | C102 | 20 | 11 | 16 | Available |
| CHEM101 | C103 | 10 | 8 | 0 | Available |
| CHEM101 | C104 | 15 | 10 | 0 | Available |
| BIO302 | HB102 | 22 | 20 | 22 | Available |
| BIO302 | HB106 | 24 | 12 | 24 | Available |
| BIO302 | HB902 | 30 | 29 | 30 | Available |
| BIO302 | W102 | 30 | 31 | 30 | Available |
| BIO302 | AB102 | 40 | 27 | 13 | Available |
Did you get any error message in the log? I suspect that your SAS version does not support indicator constraints (IMPLIES), in which case you should instead use the second (commented out) version of the RespectCapacity constraint.
It appears to me that your OPTMODEL code maximizes the total number of SEATS available in unused rooms. Do I have that correct?
But the OP appears to ask to maximize the number of unused ROOMS (minimize number of rooms used, actually). Could there not be a configuration of room sizes that satisfy your objective but would not satisfy the OP's original request?
For instance, if there are six rooms with sizes 7, 6, 6, 5, 2, and 2.
Maybe the OP doesn't care about this issue. But is there code that would do two levels of optimizing?First, minimize the count of used rooms. Then, for all combinations satisfying that objective, find one that maximizes your objective - total seats in unused rooms.
@mkeintz Yes, I included both objectives, with one of them commented out.
Yes, you can optimize multiple objectives sequentially, with a primary objective, secondary objective, tertiary objective, and so on. Here is one such example: SAS Help Center: Distribution 1: Which Factories and Depots to Supply Which Customers
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!