Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5 ( 1 0 pts ) . In this problem, we compare efficiency of various pivot rules on randomly generated linear optimization problems. For

Problem 5(10 pts). In this problem, we compare efficiency of various pivot rules on randomly
generated linear optimization problems. For your submission, include your code for parts (a)-(c),
the histograms from (c), and your written response for (d).
(a) Write modified simplex algorithms pivots_LC and pivots_B that only output the number
of pivots used when following the largest coefficient rule or Bland's rule. One way of doing
this is to start with t=0, add 1 to t each time a pivot is performed, and return t at the
end of the algorithm.
(b) The largest increase rule selects an entering variable that increases the objective function
the most during the pivot. One (inefficient) way of implementing this rule that does not
require modifying our earlier code is shown below, and you are free to use this.n = len(T[-1,:])-1 #total num of variablesr = pivot_row(T,index) #corresponding pivot rowfor j in range(index +1,n): r = pivot_row(T,j) #find corresponding pivot row return j #case of infinite increase increase =-T[-1,j]*T[r,-1]/T[r,j] #when j is pivot column max_increase = increase #overwrite previous bestreturn index #outputs index for maximum increaseRepeat part (a) by writing an algorithm pivots_LI that counts the number of pivots needed
when using this rule.
(c) The code below generates 1000 problems where AinR5050 and b,cinR50 consist of integers
between 0 and 200, solves them using the simplex algorithm with largest coefficient rule,
records the number of pivots needed in data_LC, and plots the resulting data in a histogram.data_LC = numpy.zeros(1000)
for i in range(1000):T[0:50,0:50]= numpy.random.randint (0,201,(50,50))T[50,0:50]=-1*numpy.random.randint (0,201,50)plt.hist(data_LC,bins=range(0,51))Adapt the above code to generate histograms for the number of iterations needed when
using Bland's rule or the largest increase rule. Then produce the three histograms, one for
each rule.
(d) Which of the three pivot rules appears to be most efficient? Why do you think this rule
usually performs better than the others?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions