Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple time constraint problem using C# and Microsoft Solver Foundation?

I am trying to figure out the following simple problem in order to get acquainted with Solver Foundation.

I have 8 hours, 1 room and 3 teachers. Each teacher must hold 2 lectures 1 hour long each and each teacher must not hold 2 consecutive lectures. I am having trouble finding out how to model something that contains time in it. How can that be modeled into a mathematical equation?

I am not looking for a code block that does it, but rather an explanation or may be some resources that I can read.

Thanks in advance.

like image 322
Ivan Zlatanov Avatar asked Mar 23 '26 12:03

Ivan Zlatanov


1 Answers

Since you say you have 8 hours, and each lecture must be exactly 1 hour long, can’t you just model the 8 hours as “slots” that you put the teachers “into”? It seems equivalent to assigning people to cinema seats or similar (except of course that each teacher can have two time slots).

like image 90
Timwi Avatar answered Mar 25 '26 01:03

Timwi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!