Question: Python project. Sorting problem. 2 Implementation (75%) Each student will individually implement and submit their own solution as a Python program named moving.py. to the

Python project. Sorting problem.  Python project. Sorting problem. 2 Implementation (75%) Each student will individually
implement and submit their own solution as a Python program named moving.py.
to the problem 2.1 Requirements our program must implement the following three

2 Implementation (75%) Each student will individually implement and submit their own solution as a Python program named moving.py. to the problem 2.1 Requirements our program must implement the following three greedy strategies for filling the You may use any sorting implementation you boxes. Greedy Strategy #1 (Roomiest): Sort all items by decreasing weight. Iterate desire . he items one by one, from largest weight to smallest. For each item, identify the box with the(greatest Jemaining allowed weight that can support the item, place the item in that box. Ties can be broken arbitrarily If no box can suppo the item, it is not placed in any box. Continu and either placed in a box or left ou and e until all items have been considered all items by decreasing weight. Iterate Greedy Strategy #2 (Tightest Fit): Sort rough the items one by one, from largest weight to smallest. For each item, identity remaining allowed weight that can support the item and place the box with the least the item in that box. Ties can be broken arbitrarily. If no box can support the item, it is not placed in any box. Continue until all items have been considered, and either placed in a box or left out. Greedy Strategy #3 (One Box at a Time): Sort all items by decreasing weight. Fill the boxes one by one. For each box, iterate through all remaining items (not yet placed in a previously considered box) one by one. If there is room for an item to be place in the current box, do so. (Note that this strategy can lead to different results depending on the order that boxes are considered, if the boxes have different weight capacities. You don't need to worry about this detail; you can process the boxes in any order. All of the boxes have equal weight capacity in the test cases we . will use.) Your program must prompt the user to specify an input file. It must read the input file, evaluate each of the three greedy strategies on the input data, and produce appropriate output messages. Below is an example of an input file, and appropriate output information. Your output does not need to exactly match what is below, but it must contain the same information. Example input file items1.txt 12 12 12 Abacus 3 Blender Chessboard 3 Dishes 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!