天天看點

周周記:數學模組化學習(4)

作者:LearningYard學苑
周周記:數學模組化學習(4)

分享興趣,傳播快樂,增長見聞,留下美好!

親愛的您,這裡是LearningYard新學苑。

今天小編給您帶來

【周周記:數學模組化學習(4)】

歡迎您的通路!

Share interest, spread happiness, increase knowledge, leave a beautiful!

Dear, this is LearningYard New Academy.

Today, the editor brings you

"Weekly Diary: Learning Mathematical Modeling (4)"

Welcome to your visit!

周周記:數學模組化學習(4)

一.整數線性規劃的求解方法

I. Methods for Solving Integer Linear Programming

1.舍入法的缺點:舍入得到的解非最優解,存在不滿足限制條件的情況。

1.The disadvantage of rounding method: The solution obtained through rounding is not optimal and may violate the constraint conditions.

2.完全枚舉法:将集合内的整數點一一找出,帶入函數中,其中最大目标函數的值為最優解。

2.Complete Enumeration Method: Enumerate all the integer points within the set and substitute them into the function. The maximum value of the target function among them is the optimal solution.

缺點:若集合太大,使用枚舉法十分浪費時間與資源。

Disadvantage: If the set is too large, using enumeration method will consume a lot of time and resources.

3.常見求解整數規劃的方法:分支定界法、割平面法

3.Common methods for solving integer programming: Branch and Bound Method, Cutting Plane Method.

特殊的0-1規劃問題:隐枚舉法、匈牙利法

For special 0-1 programming problems: Implicit Enumeration Method, Hungarian Method.

二.求解方法應用

II. Application of Solving Methods

1、分支定界法

1、Branch and Bound Method

周周記:數學模組化學習(4)

A.核心:先進行松弛問題解決,再在基礎上進行整數限制,若不滿足整數條件,則将不滿足條件的變量變成新的限制條件(注意是添加到松弛問題中),本質在于不斷縮小可行域,直到找到最優解或證明無解。

A. Core idea: First, solve the relaxation problem, then apply integer restrictions. If the integer condition is not satisfied, the variables that do not meet the condition are transformed into new constraint conditions (note that they are added to the relaxation problem). The essence is to continuously narrow the feasible region until finding the optimal solution or proving there is no solution.

B.流程圖:

B. Flowchart: (Diagram or flowchart should be included here, but due to the format of text, it cannot be directly displayed.)

周周記:數學模組化學習(4)

C.限制變量分為兩部分:(1)當xi≤松弛問題最優解時,進行整數最優解的尋找。

C. Constraint variables are divided into two parts: (1) When xi ≤ optimal solution of the relaxation problem, search for the integer optimal solution.

(2)當(1)不被滿足時,進行xi≥松弛問題最優解時,進行整數最優解的尋找。

(2) When (1) is not satisfied, search for the integer optimal solution when xi ≥ optimal solution of the relaxation problem.

是否可以找到最優解:(1)當xi向下取整後,是否滿足限制條件來看是否需要換方向(2)通過不斷進行限制,來找到最接近松弛問題的最優解。

Whether the optimal solution can be found: (1) Determine whether to change direction based on whether rounding down xi satisfies the constraint conditions. (2) Continuously apply constraints to find the solution closest to the optimal solution of the relaxation problem.

D.MATLAB中的函數運用

D. Function Application in MATLAB

周周記:數學模組化學習(4)

E.

周周記:數學模組化學習(4)
周周記:數學模組化學習(4)

其中,‘displa’,‘ off’表示隻顯示結果,省略中途疊代過程;

'displa', 'off' indicates only displaying the result and omitting the intermediate iteration process.

linprog表示線性規劃求解:x0表示最優解;fva10表示最優值;exitflag表示解是否存在 ,>0則存線上性規劃的解。

linprog represents the solution of linear programming: x0 represents the optimal solution; fval0 represents the optimal value; exitflag indicates whether the solution exists, > 0 means there is a solution to the linear programming problem.

作用:判斷是否存線上性規劃的解。

Function: To determine whether there is a solution to the linear programming problem.

周周記:數學模組化學習(4)

bound表示上界,inf表示無窮大,e表示可以終止算法的差。

bound represents the upper bound, inf represents infinity, e represents the difference that can terminate the algorithm.

作用:開始對函數可行域進行限制。

Function: Initially constrain the feasible region of the function.

周周記:數學模組化學習(4)

作用:判斷解是否存在

Function: To determine whether the solution exists.

周周記:數學模組化學習(4)

abs表示取絕對值;round表示取整(四舍五入);I表示第i個x0的取值;e無限正接近于0

abs represents taking the absolute value; round represents rounding (rounded to the nearest integer); I represents the value of the i-th x0; e approaches 0 indefinitely.

intindex該行表示對其中的第i個x0進行取整,後做差後的絕對值與e比較

intindex indicates rounding the i-th x0 and comparing the absolute difference with e.

作用:通過判斷intindex是否為真,為真則表示存在非整數解,則if後的語句可以不運作;若為假,則原樣輸出成為最優解;篩選整數解。

Function: By judging whether intindex is true, if true, it means there is a non-integer solution, so the statement after if can be skipped; if false, the original solution is the optimal solution; filter integer solutions.

周周記:數學模組化學習(4)

前提:已知現有非整數解

Prerequisite: Given a non-integer solution exists.

addA(n)是在對A進行限制;

addA(n) is to apply constraints to A.

zeros函數用于建立由0組成的矩陣或數組,其中的(a,b):a表示行,b表示列,(a,b)表示a行b列的全零矩陣(滿足計算和資料存儲的需求)

The zeros function is used to create a matrix or array composed of zeros, where (a, b) means a row and b columns, (a, b) represents an all-zero matrix with a rows and b columns (to meet the needs of calculation and data storage).

周周記:數學模組化學習(4)

length函數的作用

Function of length:

定義:

Definition:

周周記:數學模組化學習(4)

應用:

Application:

周周記:數學模組化學習(4)

length(f)=2;f=【-20,-10】(一行兩列),矩陣長度為2

length(f) = 2; f = [-20, -10] (a matrix with one row and two columns), the length of the matrix is 2.

floor函數表示向下取整。

floor function represents rounding down.

今天的分享就到這裡了。

如果您對今天的文章有獨特的看法,

歡迎給我們留言,

讓我們相約明天,

祝您今天過得開心!

That's all for today's share.

If you have a unique view of today's article,

Please leave us a message,

Let's meet tomorrow,

Have a nice day!

本文由LearningYard新學苑原創,如有侵權,請聯系删除。

參考資料:哔哩哔哩

翻譯:文心一言

繼續閱讀