From eab487afc627aff2a27cf06f43834039e09540bf Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@gmail.com> Date: Sat, 30 Nov 2019 01:51:24 -0500 Subject: [PATCH] Update "Initialize" to handle when temporary column is basic in aux --- resources/simplex/initialize.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/resources/simplex/initialize.py b/resources/simplex/initialize.py index 3a776b7..e26c2f4 100644 --- a/resources/simplex/initialize.py +++ b/resources/simplex/initialize.py @@ -136,8 +136,15 @@ class Initialize(): if vector_c[obj_const_index] == 0: # Solution exists for original simplex. Check status of temporary column. if temporary_col in b_array: - # Temporary column is basic. Pivot one last time to make it nonbasic. - pass + # Temporary column is basic. Pivot one last time with any value in N to make it nonbasic. + self._parent.pivot(temporary_col, n_array[0]) + + # Pivot complete. Pull parent data once more. + matrix_a = self._parent._matrix_a + vector_b = self._parent._vector_b + obj_const_index = self._parent._obj_constant_index + b_array = self._parent._b_array + n_array = self._parent._n_array # Remove temporary columns. obj_const_index -= 1 -- GitLab