Discrete Optimization Course Notes (6) - Frontiers and Tools

Table of contents

1. Large Neighborhood Search

Case1: Asymmetric TSP with time window (Asymmetric TSP with Time Windows)

2. Column Generation Algorithm (Column Generation)

Case2: Cutting Stock

3. Summary of optimization tools


1. Large Neighborhood Search

Large-scale neighborhood search is a combination of local search and CP/MIP, such as the combination of CP and local search:

  • Start with a Feasible Solution (CP)
  • Selected Neighborhood (LS)
  • Optimal Neighborhood (CP)
  • repeat the second step

Local search can solve large-scale problems, and constrained programming is suitable for finding a feasible solution and optimizing a small-scale combination space. Combining the two, constrained programming is used to optimize the large-scale neighborhood of each local search to find the best certain Neighborhood solution. How to find large-scale neighborhoods? It is possible to fix the values ​​of certain subsets of variables and only change the generating neighborhood of other variables. The determination of this subset depends on the structure of the problem.

Case1: Asymmetric TSP with time window (Asymmetric TSP with Time Windows)

There are some places that need to be reached. Each location has a service time, and its arrival time also has a time window limit. The distance between some locations may be asymmetric. It is required to find a Hamiltonian circuit that can meet the time window requirements and minimize the total distance. . In the CP model, add the start and end time constraints of each activity, which can be represented by the schedule table as shown in the right figure, and the horizontal section represents the time window. When using LNS to solve ATSPTW, first fix the positions of some points and change the positions of other points to generate Large-scale neighborhoods where the points can be together or randomly. Through the TSP benchmark, compared with the branch cuts algorithm, LNS can find a similar solution in a shorter time.

2. Column Generation Algorithm (Column Generation)

To summarize the MIP algorithm, the following are based on linear relaxation

  • branch and bound: branch and bound
  • cutting plane: secant plane method
  • branch and cuts: branch cutting plane, BB+cut, linear relaxation cutting at nodes as needed
  • branch and price: branch pricing, BB+column generation (CG), get enhanced slack in node generated columns

Next, the column generation algorithm is introduced through the Cutting Stock problem, which was proposed by Gilmore and Gomory. Gomory proposed the Gomory cut in the cut plane algorithm.

First review Reduced Cost and Dual Variables. According to the derivation of the matrix representation of LP, the objective function cx=c_{B}^{T}B^{-1}b+(c_{N}^{T}-c_{B}^{T}B^{-1}N)x_{N}, which c_{N}^{T}-c_{B}^{T}B^{-1}Nis called Reduced Cost, if there is a non-basic variable Xn so that the corresponding Reduced Cost<0, then increasing the value of Xn can make If the target value is lowered, it indicates that there is still room for optimization. Therefore, when the found solution can achieve Reduced Cost>=0, it proves that the optimal solution has been found.

Assuming that the optimal solution of the original problem is [x_{B},0], as shown in the figure below, it can be known c_{B}^{T}B^{-1}that it is the optimal solution of the dual problem, so the relationship between the Reduced Cost and the dual variable can be obtained,reduced cost=c_{N}^{T}-c_{B}^{T}B^{-1}N=c_{N}^{T}-dual*N

Case2: Cutting Stock

Suppose you need 25, 30, 14, and 8 steel pipes with a length of 3, 7, 9, and 16 meters. At present, there are only a few steel pipes with a length of 20 meters. Please arrange a reasonable cutting plan to minimize the number of steel pipes consumed. There are two modeling ideas

  • Conventional thinking: The 0/1 variable is expressed as whether to use a certain steel pipe. This kind of modeling has symmetry problems, and the linear relaxation solution is not good.
  • Column generation idea: regardless of whether to choose a certain steel pipe, but to determine the number of times a certain cutting mode (configuration) is used, so that the modeling has no capacity constraints, and there is no symmetry problem of decision variables

There are many cutting combinations, and it is impossible to enumerate all the combination sets at once, and it is unnecessary, so some cutting modes may not be used, so how to find a good cutting mode? 

Solving cutting stock problem with column generation 

(1) First, the initial cutting mode is given, and the model is solved to obtain the value of the dual variable\lambda _{i}

(2) Adding a new cutting mode p_{new}can optimize the objective function value, indicating that z_{new}the reduced cost of the variable<0, that is, reduced cost=c_{n}^{T}-c_{B}^{T}B^{-1}n=c_{n}^{T}-dual*nin this problem, c_{n}^{T}=1, the value of dual is the previous one \lambda _{i}, and n is z_{new}the coefficient matrix of the variable, that is, the new cutting mode every The number of lengths, therefore reduced cost=1-\sum \lambda _{i}c_{ipnew}<0, choose the cutting mode with the smallest reduced cost to add to the set

(3) Reconstruct a sub-problem, find the combination with the smallest reduced cost, satisfy the length constraint at the same time, and optimize the target value to the greatest extent

To sum up, the idea of ​​column generation: Compared with the model without adding new cuts, it can be regarded as a model z_{pnew}=0, so even if it is not reflected in the constraints, it is irrelevant. Find the cut combination with the smallest reduced cost through sub-problems, re-optimize the model, and complete The example solution process is as follows: 

3. Summary of optimization tools

Constraint Programming Solvers

  • CHOCO - java library, open source
  • Gecode - c++, free
  • ILog - binary, free with an academic license
  • JACOP - java, open source
  • MiniZinc/G12 - binary, free for students
  • or-tools - C++, Open Source, APIs - Java, Python and .NET

Mixed Integer Programming Solvers

  • BCP - c++, open source
  • CBC - c++, open source
  • CPlex - binary, free with an academic license
  • GLPK -c, open source
  • gurobi - binary, free with an academic license
  • LPSolve - c, open source
  • SCIP - binary, free with an academic license

Linear Programming Solvers

Local Search Solvers

SAT Solvers

Hybrid Solvers

  • SCIP - binary, free for academic use

Guess you like

Origin blog.csdn.net/weixin_45526117/article/details/128430947