2. Mathematical modeling of integer programming

1. Definition
2. Examples
3. Using software and solving problems

1. Definition

1. Integer Programming (IP for short): It is a mathematical optimization problem, which is an extended form of Linear Programming (LP for short). In linear programming, the optimization objective and constraints are linear, whereas in integer programming, in addition to these linear constraints, the variables are restricted to integer values. In integer programming problems, we need to find, given a set of variables and a set of linear constraints, integer-valued variables that satisfy these constraints so that a specific linear objective function can be maximized or minimized . Integer programming has a wide range of applications in practical problems, such as production scheduling, resource allocation, logistics planning, project scheduling, etc.

2. Compared with linear programming,
  integer programming problems are more complicated, because integer variables introduce discreteness , so that the solution space of the problem is no longer continuous. This makes integer programming problems generally more difficult to solve because the space to search for integer solutions is larger and discontinuous than the space for continuous solutions.

  Solving integer programming problems requires the use of specialized algorithms and tools , such as branch and bound method, cutting plane method, mixed integer linear programming solver, etc. These methods usually try to gradually narrow the solution space through a series of strategies in the process of searching for integer solutions to find the optimal integer solution.

3. Integer programming classification (according to different characteristics and constraints)

(1) 0-1 integer programming : In this kind of problem, the variable is restricted to take the value of 0 or 1, indicating whether to choose a certain decision. Typical applications of this type of problem include loading problems, investment decision problems , etc.

(2) Mixed integer linear programming : In this type of problem, in addition to some variables that can take continuous values, there are also some variables that need to take integer values. MILP problems are widely used in production planning, logistics network optimization and other fields.

(3) Pure integer programming : all variables must take integer values, and there are no continuous variables. This type of problem is common in fields such as production scheduling and task allocation .

(4) Multi-objective integer programming : In this kind of problem, there are multiple optimization objectives that need to be considered simultaneously. Such problems are useful in multi-objective decisions, such as balancing cost and resource utilization .

(5) Branch-and-bound integer programming : This is a commonly used method for solving integer programming problems. It decomposes the problem step by step and performs a linear programming solution on each branch, and then determines whether to further explore the branch based on the upper and lower bounds of the solution.

(6) Cutting plane integer programming : In this method, the integer solution space is gradually reduced by adding a series of cutting plane constraints to approximate the optimal solution. The cutting plane method is often used to solve MILP problems.

(7) Constraint programming : This is a method for solving discrete optimization problems. It is not only suitable for integer programming, but also for a wider range of constraint satisfaction problems. In constraint programming, the variables and constraints of the problem can have different properties, such as integers, sets, etc.

4. General steps in solving process of integer programming problems

1. Establish a mathematical model:

(1) Determine decision variables : Determine the variables that need to be optimized, as well as the meaning and scope of these variables.
(2) Determine the objective function : define the objective function that needs to be maximized or minimized, usually in the form of a linear combination.
(3) Identify constraints : List the constraints of the problem, which limit the relationship between variables.

2. Linear programming solution:

(1) Convert the integer programming problem into the corresponding linear programming problem, that is, treat all variables as continuous variables.
(2) Use linear programming solvers (such as simplex method, interior point method, etc.) to solve to obtain the optimal solution of linear programming.

3. Check the integerness of the solution:

(1) If the optimal solution of linear programming is an integer, then the solution to the integer programming problem has been found and the problem is solved.
(2) If the optimal solution of linear programming is not an integer, you need to continue with the following steps.

4. Branch and bound method:

(1) Select a branch variable : Select a variable that takes a non-integer value in the linear programming solution as a branch variable.
(2) Split the problem : Divide the problem into two sub-problems, one restricts the branch variable to be rounded down, and the other restricts the branch variable to be rounded up.
(3) Repeat the solution process for each subproblem until an integer solution is found or the problem is found to have no solution.
(4) Each time a sub-problem is solved, methods such as cutting planes and heuristics can be used to improve the solution efficiency.

5. Termination conditions:

(1) When an integer solution is found, check whether it is better than the current optimal solution and update the optimal solution.
(2) **When it is found that all branch problems have no integer solutions, or the optimal solution of the problem has been found, the solution process is terminated.

6.Output results:

Returns the optimal integer solution or approximate integer solution found as the solution to the problem.

5. Classification and definition of solution methods

(1)) Branch-and-bound method - pure or mixed integer linear programming can
  perform a systematic search appropriately for all feasible solution spaces of constrained optimization problems (the feasible solutions of which are finite numbers). This is the branch and bound method. Delimited content. Usually, the entire feasible solution space is repeatedly divided into smaller and smaller subsets, called branching; and a target lower bound (for minimum problems) is calculated for the solution set in each subset, which is called delimitation. After each branch, those subsets whose boundaries exceed the target value of the known feasible solution set will not branch further. In this way, many subsets can be ignored, which is called pruning.

(2) Cutting plane method - can solve pure or mixed integer linear programming.
(3) Implicit enumeration method - solves 0-1" integer programming.
Filtered implicit enumeration method
Branched implicit enumeration method
(4) Hungarian method - solves the assignment problem (special case of "0-1" planning).
(5) Monte Carlo method—solve various types of planning.

2. Example questions

1. Branch and bound method
insert image description here
insert image description here

insert image description here
insert image description here

3. Using software and solving problems

1. Matlab solution
insert image description here
method 1: Write the Matlab program as follows:

c=[3 8 2 10 3;8 7 2 9 7;6 4 2 7 5
   8 4 2 3 5;9 10 6 9 10];
c=c(:);
a=zeros(10,25);
for i=1:5
   a(i,(i-1)*5+1:5*i)=1;
   a(5+i,i:5:25)=1;
end
b=ones(10,1);
[x,fval]=bintprog(c,[],[],a,b);
x=reshape(x,[5,5]), fval

2.1.LINGO solution
Solution method 2: The LINGO program is as follows


model:
sets:
var/1..5/;
link(var,var):c,x;
endsets
data:
c=3 8 2 10 3
  8 7 2 9 7
  6 4 2 7 5
  8 4 2 3 5
  9 10 6 9 10;
enddata
min=@sum(link:c*x);
@for(var(i):@sum(var(j):x(i,j))=1);
@for(var(j):@sum(var(i):x(i,j))=1);
@for(link:@bin(x));
end

Guess you like

Origin blog.csdn.net/qq_55433305/article/details/132453676