114 年 國立臺灣大學工業工程學研究所碩士班產業與服務系統工程組《作業研究》
第 1 題30 分
- (30 points) Consider the following primal linear programming problem (P).
Minimize
subject to
(a) If , find an initial feasible solution of by using Phase-I of the two-phase method.
(b) If , find an optimal solution of by using the simplex method.
(c) Write the dual problem.
(d) If , what is the optimal solution to the dual problem and its corresponding objective value of the dual problem?
(e) If , find an optimal solution of to the primal problem (P) starting from a trivial infeasible solution, , by using the dual simplex method.
(f) Construct the allowable range of that the optimal solution obtained in (b) stays optimal.
登入後即可作答並保存紀錄。
核心觀念
本題整合線性規劃的幾項核心技巧:
- 兩階段法 Phase-I:先加入人工變數,求得原問題的可行基底解。
- 單純形法 Simplex Method:由可行基底解判斷是否仍有可改善的非基底變數。
- 對偶問題 Dual Problem:依照原問題的最小化形式、等式限制與非負變數建立對偶。
- 對偶單純形法 Dual Simplex Method:由「對偶可行但原始不可行」的基底解出發。
- 目標係數允許範圍:保持目前基底解最適,必須使所有非基底變數的 reduced cost 維持最適條件。
(a) 使用 Phase-I 求初始可行解
原問題第一條限制式的右側為負,先將其乘以 :
加入人工變數 :
第二條限制式為:
Phase-I 的目標為最小化人工變數:
令 為基底變數,其他變數設為 :
此時 ,故初始 Phase-I 解為:
由第一式可得:
當 進入基底時, 會先降至 ;由第二式可知 尚未先變成負值,因此令 離開基底。
由
解出:
再代入第二式:
令非基底變數 ,得到:
且人工變數 ,因此原問題的一組初始可行解為:
(b) 使用單純形法求最適解
當 時,目標函數為:
沿用 (a) 所得到的基底 ,將限制式寫成字典形式:
代入目標函數:
由於 ,且目標函數中兩者的係數均為正值,因此增加任一非基底變數都會使 增加。最小值在:
時取得。
因此:
最適解為:
最適目標值為:
(c) 建立對偶問題
原問題為:
兩條限制式都是等式,因此先令對偶變數 不受符號限制。
因為原問題是最小化問題,且所有原始變數均為非負,因此對偶限制式為「小於等於」。
對偶目標函數為:
逐一依照原始變數建立對偶限制式:
- 對應第一欄 :
- 對應第二欄 :
- 對應第三欄 ,其成本為 :
- 對應第四欄 ,其成本為 :
故對偶問題為:
(d) 時對偶問題的最適解
由 (b) 的原問題最適解:
使用互補鬆弛條件。
因為 ,其對偶限制式必須為等式:
因為 ,其對偶限制式也必須為等式:
代入 :
因此:
對偶最適解為:
對偶目標值為:
因此:
原問題與對偶問題的最適值相同,符合強對偶定理:
(e) 使用對偶單純形法
題目指定起始解:
由限制式表示基底變數:
目標函數為:
此時:
- ,所以原始解不可行;
- ;
- 目標函數中非基底變數 的 reduced cost 均為非負,因此對偶可行。
這正是對偶單純形法的起始條件:原始不可行、對偶可行。
選擇離開基底的變數
選擇負的基底變數 離開基底:
為使 增加至非負, 或 可進入基底。
依對偶單純形法的比值判定:
因此選擇 進入基底。
由 方程解出 :
代入 :
代入目標函數:
第 2 題20 分
- (20 points) Suppose you will choose 10 dishes from four meal types (pork, beef, vegitable, and grain). At least one dish from each meal type must be chosen. The 10 dishes are allocated to the four meal types in a manner that maximizes "nutrition." You measures nutrition on a 100-point scale as shown in the following table.
| Meal types | 1 | 2 | 3 | 4 | 5 | 6 | ≥7 |
|---|---|---|---|---|---|---|---|
| Pork | 25 | 50 | 60 | 80 | 100 | 100 | 100 |
| Beef | 20 | 70 | 90 | 100 | 100 | 100 | 100 |
| Vegitable | 40 | 60 | 80 | 100 | 100 | 100 | 100 |
| Grain | 10 | 20 | 30 | 40 | 50 | 60 | 70 |
How should you choose the dishes? Please answer the following questions.
(a) What are the stages and states for the dynamic programming formulation of this problem?
(b) Use dynamic programming to solve this problem.
登入後即可作答並保存紀錄。
核心觀念
本題考查動態規劃的階段、狀態與遞迴關係。將四種餐點依序分配菜色,每種至少選一道,且各種類的營養分數依所選數量查表。目標是使四種類的營養分數總和最大。
設 為第 種餐點選 道時的營養分數,則總分為四種餐點分數的加總。
(a) 階段與狀態
- 階段:每個階段處理一種餐點,依序為豬肉、牛肉、蔬菜、穀類。
- 狀態:已分配給目前及先前餐點的菜色總數。
- 決策:在目前階段所處理的餐點選幾道;每種至少一道。
令 表示前 種餐點共分配 道菜時可得到的最高營養分數。初始條件為:
對 ,遞迴式為:
其中 是第 種餐點的菜數;上限 確保前 種餐點各至少有一道。最後求 。
(b) 動態規劃求解
先合併豬肉與牛肉,計算 。表中的配置欄列出達到最高分的一組豬肉、牛肉菜數。
| 總菜數 | 最佳配置(豬肉、牛肉) | |
|---|---|---|
| 2 | 45 | |
| 3 | 95 | |
| 4 | 120 | |
| 5 | 140 | |
| 6 | 150 | |
| 7 | 170 | |
| 8 | 190 | |
| 9 | 200 |
例如,兩種餐點合計選 道時:
此時豬肉選 道、牛肉選 道。
接著加入蔬菜,依遞迴式計算 :
| 總菜數 | 一組最佳配置(豬肉、牛肉、蔬菜) | |
|---|---|---|
| 3 | 85 | |
| 4 | 135 | |
| 5 | 160 | |
| 6 | 180 | |
| 7 | 200 | |
| 8 | 220 | |
| 9 | 240 |
例如,前三種餐點合計選 道時,逐一比較蔬菜菜數 :
第 3 題30 分
- (30 points) Consider the following optimization problem
subject to
Answer the following questions.
(a) Show that is convex.
(b) Write down the Karush-Kuhn-Tucker (KKT) conditions necessary for solving this optimization problem.
(c) Continuing with (b), can you find a feasible solution when both constraints and are "inactive"? Show the details.
(d) Continuing with (b), identify the feasible solution(s) and check whether or not the Linear Independence Constraint Qualification (LICQ) holds at .
(e) Find the global minimizer and the optimal value of .
登入後即可作答並保存紀錄。
【答案】
(a) 證明略,目標函數 之 Hessian 矩陣 各階領先主子式均為正,為正定矩陣,故 為嚴格凸函數,亦為凸函數。
(b) 最佳化問題之 KKT 條件為:
- 梯度條件(Stationarity): 且
- 原問題可行性(Primal Feasibility): 且
- 對偶可行性(Dual Feasibility): 且
- 互補鬆弛條件(Complementary Slackness): 且
(c) 不存在。當限制條件 皆為非主動約束(inactive)時,,解得無約束平穩點為 ,此點違反原問題可行性條件( 且 ),故無可行解。
(d) 滿足 KKT 條件之唯一解為 ,對應之拉格朗日乘子為 。該點處主動約束之梯度向量分別為 與 ,兩者線性獨立,故線性獨立限制條件資格(LICQ)在此點成立。
(e) 全域極小點為 ,全域最佳值為 。
詳解
本題考查非線性規劃與凸最佳化理論,涵蓋凸函數判定、Karush-Kuhn-Tucker(KKT)條件推導、主動約束分析、線性獨立限制條件資格(LICQ)檢驗,以及凸規劃全域最佳解之求取。
一、(a) 證明 為凸函數
給定目標函數:
計算其一階偏導數:
計算其二階偏導數並建立 Hessian 矩陣 :
檢驗矩陣 之領先主子式(Leading Principal Minors):
- 一階領先主子式:
- 二階領先主子式:
因所有領先主子式皆嚴格大於零,Hessian 矩陣 為正定矩陣(Positive Definite)。根據凸分析定理,二階連續可微函數在定義域上之 Hessian 矩陣處處正定,則該函數為嚴格凸函數(Strictly Convex),必然為凸函數。
二、(b) 寫出 KKT 條件
原最佳化問題標準形式為:
引入非負拉格朗日乘子 ,定義拉格朗日函數:
KKT 條件包含:
- 平穩性條件(Stationarity / 梯度條件):
因 ,,分量式為:
- 原問題可行性(Primal Feasibility):
- 對偶可行性(Dual Feasibility):
- 互補鬆弛條件(Complementary Slackness):
三、(c) 當兩約束皆非主動(inactive)時尋找可行解
若限制條件 與 皆非主動約束,即 且 。
由互補鬆弛條件可得拉格朗日乘子必為零:
將其代入平穩性條件:
解此線性聯立方程組:第二式減第一式得 ,代回第一式得 。
此平穩點為 。
檢驗可行性:
- (違反 )
- (違反 )
第 4 題20 分
- (20 points) There is a small YouBike station on the NTU campus, which has a maximum capacity of 2 bike docks. Suppose time is divided into discrete slots 1, 2, ..., where at any point in time, the following 2 random events may occur:
A bike is returned with probability ,
A bike is rented with probability .
Define the state of the system as the number of bikes on the docks, then it can be modeled as a discrete-time Markov chain. Answer the following questions.
(a) Identify the state space and the transition probability matrix of this Markov chain.
(b) When a student arrives at the Youbike station to rent a bike, what is the probability that both docks are empty? (Hint: You can solve the steady-state probabilities from the flow balance equations.)
(c) If a student arrives at the Youbike station, how many bikes does he expect to see on the docks?
(d) A manager of YouBike company comes to observe the operation of this particular station. When he arrives at the station, both docks are empty. What is the expected number of time units until 2 bikes will be on the docks?
登入後即可作答並保存紀錄。
核心觀念
本題考察有限狀態離散時間馬可夫鏈,包括:
- 狀態空間的建立
- 轉移機率矩陣
- 穩態機率與流量平衡
- 穩態下的期望值
- 首達時間的期望值
令狀態 表示第 個時間槽結束時停放在站上的腳踏車數量。由於最多只有 個車位,因此狀態只可能為 。
其中:
- 歸還腳踏車的機率為
- 租借腳踏車的機率為
在狀態 時,雖然租借事件仍可能發生,但因為沒有腳踏車可租,系統仍停留在狀態 。在狀態 時,雖然歸還事件仍可能發生,但因為車位已滿,系統仍停留在狀態 。
(a) 狀態空間與轉移機率矩陣
狀態空間
各狀態的轉移
由狀態 :
- 歸還一輛:,機率
- 租借事件但無車可租:,機率
由狀態 :
- 歸還一輛:,機率
- 租借一輛:,機率
由狀態 :
- 歸還事件但無空位:,機率
- 租借一輛:,機率
依照狀態排列順序 ,轉移機率矩陣為
每一列的總和皆為 ,符合轉移機率矩陣的要求。
(b) 租借學生遇到兩個車位皆空的機率
設穩態機率為
其中 表示長期而言系統處於狀態 的機率。
此題是出生—死亡型馬可夫鏈,利用相鄰狀態的流量平衡:
因此
同理,
所以
再利用機率總和為 :
代入上式:
因此
當學生到站租借時,若系統處於穩態,遇到兩個車位皆空的機率就是處於狀態 的穩態機率:
因此,機率約為 。
(c) 學生預期看到的腳踏車數量
穩態下,腳踏車數量的期望值為
由前面的計算,
因此
所以學生預期看到的腳踏車數量為
(d) 從兩個車位皆空到停滿兩輛的期望時間
令
- :從狀態 出發,首次到達狀態 所需的期望時間
- :從狀態 出發,首次到達狀態 所需的期望時間
- :已經在狀態 ,因此首達時間為
建立 的遞迴式
從狀態 出發:
- 以機率 留在狀態
- 以機率 到達狀態
每次轉移消耗一個時間單位,因此
代入 、:
整理得