Using Variable Domain Functions

Using Variable Domain Functions
The variable domain functions are
@GIN : It used for any positive integer value
@BIN : It used for any binary value ( 0 or 1)
Example 1
Solve the following problem by LINGO
MAX Z= 18X +14X +8X +4X
Subject to
15x +12x +7x +4x +x ≤ 37
x ,x ,x ,x ,x =(0,1)
1
1
1
2
2
3
4
3
5
2
4
3
5
4
Example 2
Suppose that we have 3 jobs (1, 2, 3) waiting for being performed and 3
machines (A, B, C) that can be used to perform these jobs. The assignment
costs of the jobs to the machines are given in the following table. Find the
minimum total cost one-to-one assignment between the jobs and the machines
by using lingo programming.
Min z= 9x11+6x12+3x13+4x21+5x22+6x23+3x31+7x32+11x33
Subject to
x11+x12+x13=1
x21+x22+x23=1
x31+x32+x33=1
x11+x21+x31=1
x12+x22+x31=1
x13+x23+x33=1
x11, x12,x13,x21,x22,x23,x31,x32 and x33 are binary variables
Example 3
Find the optimal solution by using LINGO
Max z= 3x1+x2+3x3
Subject to
-x1+2x2+x3≤4
4x2-3x3 ≤ 2
X1-3x2+2x3 ≤ 3
x1,x2 and x3 ≥ 0 and integer
Example 4
Solve the following knapsack problem by using lingo software :
Maximize z= 5X1+3X2+8X3+9X4+4X5
Subject to
3X1+X2+5X3+4X4+X5=25
0≤X1 ≤2 , 0 ≤X2 ≤1 , 0 ≤X3 ≤4 , 0 ≤X4 ≤2, 0 ≤X5 ≤1
X1,X2,X3,X4,and X5 and integer.