Integer and Binary Problems in MPL, by Gabriel Plano After the “subject to” section which has your constraints, you must declare which variables are integers or binary. Do this by simply writing “integer” or “binary” followed by the list of variables that you want to make integer or binary, with each variable follow by a semicolon. These can be either scalar or vector variables. Here is how you would solve example 3 from section 11.4 in MPL. ==================================================================================================================== index flight := 1..11; ! there are 11 flights sequence := 1..12; ! there are 12 possible sequences data Cost[sequence] := (2,3,4,6,7,5,7,8,9,9,8,9); ! In 1000's of dollars Table1[flight,sequence] := ( 1,0,0,1,0,0,1,0,0,1,0,0, ! This table shows whether a flight (row) is 0,1,0,0,1,0,0,1,0,0,1,0, ! is serviced by a certain sequence (column). 0,0,1,0,0,1,0,0,1,0,0,1, ! This comes from table 11.4. 0,0,0,1,0,0,1,0,1,1,0,1, 1,0,0,0,0,1,0,0,0,1,1,0, 0,0,0,1,1,0,0,0,1,0,0,0, 0,0,0,0,0,0,1,1,0,1,1,1, 0,1,0,1,1,0,0,0,1,0,0,0, 0,0,0,0,1,0,0,1,0,0,1,0, 0,0,1,0,0,0,1,1,0,0,0,1, 0,0,0,0,0,1,0,0,1,1,1,1 ); variables Crew_Assignments[sequence]; model min Total_Cost = SUM(sequence: Cost*1000*Crew_Assignments); subject to C1[flight]: sum(sequence: Crew_Assignments) = 3; ! All 3 crew must have an assignment. C2[flight]: sum(sequence: Crew_Assignments*Table1) >= 1; ! Each flight must be taken at least once. binary Crew_Assignments; ! Each individual element of this vector variable is binary end ==================================================================================================================== You could also write "binary variables Crew_Assignments[sequence];" when defining the Crew_Assignments variable. In this case you would not need to declare that Crew_Assignments is binary again at the end of the file. When you solve this problem by going to Run -> Solve CPLEX 300, you will see that sequences 3,4, and 11 are used and that the total cost is $18,000.