I am trying to learn Julia with optimization problems. I tried to solve a scheduling problem. Here is the question that I want to solve with Cbc library. - There are 6 time periods, 10 seminar, 5 speaker, 15 audience, and 4 conference room.
Which speaker offer which seminar is given as a matrix (5x10) Speaker
, and which audience will participate in which seminar is shown in below matrix Audience
:
Speaker = [1 1 0 0 0 0 0 0 0 0;
0 0 1 1 0 0 0 0 0 0;
0 0 0 0 1 1 0 0 0 0;
0 0 0 0 0 0 1 1 0 0;
0 0 0 0 0 0 0 0 1 1 ];
Audience = [1 1 0 1 0 0 0 0 0 0;
0 0 1 0 1 0 0 1 0 0;
0 0 1 0 1 0 0 1 0 0;
0 0 1 0 1 0 0 1 0 0;
0 0 1 0 1 0 0 1 0 0;
1 1 0 1 0 0 0 0 0 0;
0 0 0 0 0 1 1 0 0 1;
0 0 0 0 0 1 1 0 0 1;
0 0 0 0 0 1 1 0 0 1;
1 1 0 1 0 0 0 0 0 0;
1 1 0 1 0 0 0 0 0 0;
0 0 0 0 0 0 1 0 1 1;
0 0 0 0 0 0 1 0 1 1;
0 0 0 0 0 0 1 0 1 1;
0 0 0 0 0 0 1 0 1 1];
numberOfSeminar = 10; # Number of seminars
numberOfAudience = 15; # Number of audience
numberOfSpeakers = 5; # Number of speakers
numberOfTimePeriods = 6; # Number of time periods
numberOfRooms = 4; # Number of conference room
using JuMP, Cbc
model = Model(with_optimizer(Cbc.Optimizer))
@variable(
#CONSTRAINTS
#1.In a time and place, at most one seminar will be schedule.
@constraint()
#2. All seminars get two time periods.
@constraint()
#3. A seminar cannot be scheduled to two different conference room at the same time (no sections)
@constraint()
#4. A speaker cannot be in two different seminar at the same time
@constraint()
#5. A audience cannot be in two different seminar at the same time
@constraint()
I also can not configure its model. I know some constraints are needed and at the end of the code I must optimize it with
optimize!(model)
By the way can I print the schedule after optimization? Is there any way? I want to print out the result.