In stores, boxes should be placed in an organized way otherwise it will be messy. Given...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In stores, boxes should be placed in an organized way otherwise it will be messy. Given a collection of boxes, it is requested to place them on top of each other to reach the minimum possible height. There is a condition, where a box cannot be placed on top of another box unless the area of its 2D base is smaller or equal of the 2D base of the lower box. It is allowed to rotate any box to use any two sides as its base. For example, consider below 4 boxes where each box has the following dimensions Input: Box 1: (2,1,3), Box 2:(6,3,8) Box 3: (4,2,5), Box 4:(3,1,6). Output: From bottom to top as follows: In the bottom → Box 2 on the base (6,8) and height 3, On top of it →→ Box 3 on the base (4,5) and height 2, Then → Box 4 on the base (6,3) and height 1, Finally → Box 1 on the base (2,3) and height 1. The total height is 7 [Explanation: as we can see that the first box in the bottom is the box 2 with base 6x8 and height 3, then box3 with base 4x5 and height 2, and so on. This arrangement of boxes fulfils the constraint mentioned above: "the dimensions of the 2D base of the lower box are each strictly larger than those of the 2D base of the higher box". This solution also satisfies the shortest possible stack] a) Describe how a brute-force approach algorithm would solve the above problem (4 marks), and explain its complexity (2 marks). b) Design an algorithm to solve the above scenario for N boxes. (6 marks) [The efficiency of your algorithm is the main driver of the mark], and analyze the complexity of your solution. (2 marks) [full explanation of your answer should be provided] c) Develop a python code to implement your efficient algorithm. (10 marks) [The marks depend on the correctness of the code, indentation, comments, test-case] d) Prepare a brief report (250 words) comparing the two algorithms (6 marks) In stores, boxes should be placed in an organized way otherwise it will be messy. Given a collection of boxes, it is requested to place them on top of each other to reach the minimum possible height. There is a condition, where a box cannot be placed on top of another box unless the area of its 2D base is smaller or equal of the 2D base of the lower box. It is allowed to rotate any box to use any two sides as its base. For example, consider below 4 boxes where each box has the following dimensions Input: Box 1: (2,1,3), Box 2:(6,3,8) Box 3: (4,2,5), Box 4:(3,1,6). Output: From bottom to top as follows: In the bottom → Box 2 on the base (6,8) and height 3, On top of it →→ Box 3 on the base (4,5) and height 2, Then → Box 4 on the base (6,3) and height 1, Finally → Box 1 on the base (2,3) and height 1. The total height is 7 [Explanation: as we can see that the first box in the bottom is the box 2 with base 6x8 and height 3, then box3 with base 4x5 and height 2, and so on. This arrangement of boxes fulfils the constraint mentioned above: "the dimensions of the 2D base of the lower box are each strictly larger than those of the 2D base of the higher box". This solution also satisfies the shortest possible stack] a) Describe how a brute-force approach algorithm would solve the above problem (4 marks), and explain its complexity (2 marks). b) Design an algorithm to solve the above scenario for N boxes. (6 marks) [The efficiency of your algorithm is the main driver of the mark], and analyze the complexity of your solution. (2 marks) [full explanation of your answer should be provided] c) Develop a python code to implement your efficient algorithm. (10 marks) [The marks depend on the correctness of the code, indentation, comments, test-case] d) Prepare a brief report (250 words) comparing the two algorithms (6 marks)
Expert Answer:
Answer rating: 100% (QA)
a A bruteforce approach algorithm would solve the above problem by generating all possible arrangements of the boxes and checking if each arrangement ... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Given a collection of points (x1, y1). (x2 > y2),. . . . . . . . , (xn, yn)> let and let y = c0 + c1x be the linear function that gives the best least squares fit to the points. Show that if = 0 then...
-
A collection of five routers is to be connected in a point-to-point subnet. Between each pair of routers, the designers may put a high-speed line, a medium-speed line, a low-speed line, or no line....
-
Given a collection of particles with positions ri, let the force on the ith particle, due to all the others, be Finti . Assuming that the force between any two particles is directed along the line...
-
Find the smallest positive angle and the smallest negative angle (numerically) coterminal with but not equal to the given angle. 47.0
-
Using the P/E ratio approach to valuation, calculate the value of a share of stock under the following conditions: The investors required rate of return is 12 percent, The expected level of...
-
During its execution, a transaction passes through several states, until it finally commits or aborts. List all possible sequences of states through which a transaction may pass. Explain why each...
-
White Company can invest in one of two projects, TD1 or TD2. Each project requires an initial investment of $101,250 and produces the year-end cash inflows shown in the following table. Required 1....
-
Flight Caf is a company that prepares in-flight meals for airlines in its kitchen located next to the local airport. The companys planning budget for July appears below: In July, 17,800 meals were...
-
Write a program in c to detect if the system will face any deadlock in the future. If a deadlock is detected then print "Deadlock Ahead" otherwise print "Safe here". The situation is given below....
-
A 2 4 factorial design was run in a chemical process. The design factors are A = time, B = concentration, C = pressure, and D = temperature. The response variable is yield. The data follow: (a)...
-
Biotech stocks crumbled last year, and many prominent hedge funds have suffered deep losses. But some biotech investors are thriving by focusing on mergers, short selling, and Covid-19 stocks. Some...
-
Elaborate on planning, managing, and evaluating healthcare policies and program and its important, provide sources.
-
Why did choose this topic of Factors Affecting costs and risks in manufacturing industry?
-
Provide a copy of the coaching needs for each person and discuss how you arranged times for coaching. Perform the following steps with each of the four colleagues to coach them on-the-job and within...
-
The Elevated Transportation Company developed plans for a monorail project in and near downtown Seattle. The new "Green Line" would extend 14 miles and serve Seattle Center, downtown, and the stadium...
-
Computador has a manufacturing plant in Des Moines that has the theoretical capability to produce 193,500 laptops per quarter but currently produces 77,400 units. The conversion cost per quarter is...
-
You are considering buying a preferred stock that has just paid a semi-annually dividend of $10. The required rate of return is 17.0%. The dividends' semi-annual growth rate is 1.2% . The preferred...
-
H.J. Heinzs annual dividends were as follows: 1990 ..............$0.540 1991.............. 0.620 1992 .............. 0.700 1993.............. 0.780 1994 .............. 0.860 1995 .............. 0.940...
-
A spool consists of an axle of radius r and an outside circle of radius R which rolls on the ground. A thread is wrapped around the axle and is pulled with tension T, at an angle ? with the...
-
A beach ball is thrown upward with initial speed v0. Assume that the drag force from the air is F = mv. What is the speed of the ball, vf , when it hits the ground? (An implicit equation is...
-
In As frame, B moves to the right with speed u, and C moves to the left with speed v. What is the speed of B with respect to C? In other words, use 4-vectors to derive the velocity-addition formula.
-
Crane l uses 10 kJ of energy to lift a 50 kg box to the roof of a building. Crane 2 uses 20 kl to lift a 100 kg box the same distance. Which crane is more efficient? A. Crane 1 B. Crane 2 C. Both...
-
Christina throws a javelin into the air. As she propels it forward from rest, she does 270 J of work on it. At its highest point, its gravitational potential energy has increased by 70 J. What is the...
-
Two samples of ideal gas, sample 1 and sample 2, have the same thermal energy. Sample l has twice as many atoms as sample 2. What can we say about the temperatures of the two samples? A. T>T B. T = T...
Study smarter with the SolutionInn App