Answered step by step
Verified Expert Solution
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 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 ac
the histograms from c and your written response for
a Write modified simplex algorithms pivotsLC and pivotsB 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 add to each time a pivot is performed, and return 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 lenT: #total num of variablesr pivotrowTindex #corresponding pivot rowfor j in rangeindex n: r pivotrowTj #find corresponding pivot row return j #case of infinite increase increase TjTrTrj #when j is pivot column maxincrease increase #overwrite previous bestreturn index #outputs index for maximum increaseRepeat part a by writing an algorithm pivotsLI that counts the number of pivots needed
when using this rule.
c The code below generates problems where and consist of integers
between and solves them using the simplex algorithm with largest coefficient rule,
records the number of pivots needed in dataLC and plots the resulting data in a histogram.dataLC numpy.zeros
for i in range:T:: numpy.random.randint T:numpyrandom.randint plthistdataLCbinsrangeAdapt 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?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started