question archive Barplots and Boxplots in the Same Figure

Barplots and Boxplots in the Same Figure

Subject:Computer SciencePrice: Bought3

Barplots and Boxplots in the Same Figure. In Operations Research we often deal with problems for which it is very time-consuming to find the/an optimal solution. In such cases, heuristics are useful for finding what are (hopefully) "very good" solutions. You will be given data describing objective function values for numerous maximization optimization problems. Each problem has an ID number (to uniquely identify the problem). Each problem was then solved optimally, and was also tested with three (3) different heuristics. We want to visualize the "optimality gap" for each heuristic. That is, the percentage difference between the optimal objective function value (OFV) and each heuristic's OFV.

(a) Your Jupyter notebook should read from a file named solution data.csv, which will be saved in the same directory/folder as your .ipynb notebook. • A sample/practice file has been provided for you. However, the TA will replace this file with different data. • Your code should ignore any rows that begin with the percent sign (%), which denotes a comment. • The data file will contain three columns. The first column of each row will contain a problem ID; the second column will describe the solution approach used to solve the problem; the third column will contain the corresponding OFV. • You may assume that the second column will only contain the following text strings: "optimal", "genetic algorithm", "simulated annealing", and "tabu search".

(b) develop a single figure with two subplots. The figure should be labeled "Comparison of Optimality Gaps for Heuristics". i. The first (left) subplot will be a barplot showing the average optimality gap for each heuristic. Each bar should be colored orange, with thin black outlines; label each bar along the x-axis; include a label for the y-axis, and provide a title for the barplot. ii. The second (right) subplot will be a boxplot showing the spread of optimality gaps for each heuristic. Label each bar along the x-axis; color the median line orange; be sure that the scale of the y-axis is the same for both plots; and provide a title for the boxplot. NOTE: The optimality gap for a heuristic, represented as a percentage, is calculated as:

gap = (optimal OFV) − (heuristic OFV)/ (optimal OFV) ∗ 100, where positive gaps indicate that the heuristic's solution was suboptimal for a maximization objective.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions