From bf949c82e6abe566228e52a1e170898a0732bab4 Mon Sep 17 00:00:00 2001 From: Claudio Maggioni Date: Sat, 19 Dec 2020 23:50:07 +0100 Subject: [PATCH] --amend --- mp6/Project_6_Maggioni_Claudio/auxiliary.m | 23 ++++++------------ mp6/Project_6_Maggioni_Claudio/exercise4.m | 7 +++--- mp6/Project_6_Maggioni_Claudio/simplexSolve.m | 2 +- mp6/project_6_Maggioni_Claudio.pdf | Bin 155236 -> 156157 bytes mp6/project_6_Maggioni_Claudio.tex | 21 +++++++++++----- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/mp6/Project_6_Maggioni_Claudio/auxiliary.m b/mp6/Project_6_Maggioni_Claudio/auxiliary.m index 344216a..0016885 100644 --- a/mp6/Project_6_Maggioni_Claudio/auxiliary.m +++ b/mp6/Project_6_Maggioni_Claudio/auxiliary.m @@ -1,10 +1,8 @@ function [B,D,c_B,c_D,x_B,x_D,index_B,index_D] = auxiliary (A_aug,c_aug,h,m,n) % The auxiliary problem is always a minimization problem -% The output will be: B and D (basic and nonbasic matrices), c_B and c_D -% (subdivision of the coefficient vector in basic and nonbasic parts), x_B -% and x_D (basic and nonbasic variables) and index_B and index_D (to keep -% track of the variables indices) +% The output will be: B and D (basic and nonbasic matrices), c_B and c_D (subdivision of the coefficient vector in basic and nonbasic parts), x_B +% and x_D (basic and nonbasic variables) and index_B and index_D (to keep track of the variables indices) % Redefine the problem by introducing the artificial variables required by % the auxiliary problem (the objective function has to reach value 0) @@ -39,8 +37,7 @@ r_D = c_Daux - c_Baux*BiD; while(z~=0) % Find nonnegative index - idxIN = find(r_D == min(r_D)); - + idxIN = find(r_D==min(r_D)); % Using Bland's rule to avoid cycling if(size(idxIN,2)>1) idxIN = min(idxIN); @@ -85,21 +82,17 @@ while(z~=0) Bih = B\h; % Compute reduced cost coefficients - r_D = c_Daux - (c_Baux * BiD); - - % Exercise 4: Uncomment this to experience "oscillation" - %fprintf("iteration %d: in %d out %d z %d\n", nIter+1, idxIN, idxOUT, z); - %B - %D + r_D = c_Daux - c_Baux*BiD; % Detect inefficient loop if nIter > total number of basic solutions nIter = nIter + 1; - if nIter > itMax + if(nIter>itMax) error('The original LP problem does not admit a feasible solution.'); end - x_B = Bih - BiD * x_D; - z = c_Baux * x_B; + x_B = Bih - BiD*x_D; + z = c_Baux*x_B; + end check = index_D<(n+m+1); diff --git a/mp6/Project_6_Maggioni_Claudio/exercise4.m b/mp6/Project_6_Maggioni_Claudio/exercise4.m index 19893b5..1e99627 100644 --- a/mp6/Project_6_Maggioni_Claudio/exercise4.m +++ b/mp6/Project_6_Maggioni_Claudio/exercise4.m @@ -1,9 +1,8 @@ type = 'max'; -A = [4 3; 4 1; 4 2; 1 0; 0 1]; -sign = [-1 ; -1 ; -1 ; 1 ; 1 ]; -h = [12 ; 8 ; 8 ; 0 ; 0 ]; +A = [4 3; 4 1; 4 2]; +sign = [-1 ; -1 ; -1 ]; +h = [12 ; 8 ; 8 ]; c = [3 4]; - [z,x_B,index_B] = simplex (type,A,h,c,sign); histogram([index_B x_B']') \ No newline at end of file diff --git a/mp6/Project_6_Maggioni_Claudio/simplexSolve.m b/mp6/Project_6_Maggioni_Claudio/simplexSolve.m index cf9609d..f2587e4 100644 --- a/mp6/Project_6_Maggioni_Claudio/simplexSolve.m +++ b/mp6/Project_6_Maggioni_Claudio/simplexSolve.m @@ -34,7 +34,7 @@ while optCheck ~= tol ratio = Bih ./ BiD(:,idxIN); % Find the smallest positive ratio - idxOUT = find(ratio == min(ratio(ratio > 0))); + idxOUT = find(ratio == min(ratio(ratio >= 0))); out = B(:,idxOUT); c_out = c_B(1,idxOUT); diff --git a/mp6/project_6_Maggioni_Claudio.pdf b/mp6/project_6_Maggioni_Claudio.pdf index 5bb6c307e7e2dabf5a41412a4cbe8df500346a42..c5c9612604166117df1d158bcd287e7be9378aad 100644 GIT binary patch delta 11843 zcmai%(?h3$!i001ZQHi7*>-Jhwv9Jzwr#u3wvDY{-r8(i-#O@cZ@ z^P#%0o|h8X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_Maggioni_Claudio.tex +++ b/mp6/project_6_Maggioni_Claudio.tex @@ -361,16 +361,17 @@ The MATLAB implementation for this problem can be found under file \texttt{Project\_6\_Claudio\_Maggioni/}). The simplex method implementation for this problem fails with an error in the -auxiliary problem initialization. The error message is ``The original LP problem does not admit a feasible -solution''. This error message appears when the simplex method does not +\texttt{simpleSolve} iterative method. The error message is +``Incorrect loop, more iterations than the number of basic solutions''. +This error message appears when the simplex method does not converge in the expected maximum number of iterations. The large number of -iterations (793 before forced termination) is caused by an ``oscillation'' or +iterations (11 before forced termination) is caused by an ``oscillation'' or vicious cycle of swap operations between matrix $B$ and matrix $D$. This oscillation is cause by the fact that entering and departing variable indexes do -not change, and stay fixed at values 6 and 4 from the second iteration onwards. +not change, and stay fixed at values 1 and 3 from the second iteration onwards. This causes an unnecessary continuous oscillation between two solutions that are -equally not optimal ($z = 28$) according to the auxiliary problem definition, -terminating the auxiliary algorithm abnormally after too many iterations. +equally not optimal ($\text{optCheck} = 1$) according to the simplex algorithm definition, +terminating the simplex algorithm algorithm abnormally after too many iterations. \subsection{Look at the number of constraints and at the number of unknowns: what can you notice about the underlying system of equations? Represent them @@ -385,6 +386,14 @@ triangular shape, and it is made up only of one constraint other than the trivial positivity constraints at the axes (i.e. the constraints different from $4x +2y \leq 8$ do not make a difference in the feasability region). +The system has 2 variables and 3 constraints, other than the positivity checks +on the variables. But, for what said above, 2 out of the three constraints are +useless and thus make the feasibility region defined like a 1-condition problem. + +This lack of ``useful'' condition may cause a ill-defined set of constraints +that could produce two equally ``good'' not-optimal solutions, thus causing the +infinite loop in the simplex algorithm. + \begin{figure}[h] \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45]