Python Forum

Full Version: Cage filling algorithm - Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Cage filling exercise - Design an algorithm to fill a cage as efficiently as possible Within Tesco’s supply chain, utilisation of space is key to maximising efficiency in both the transport and storage of stock. Stock is typically transported in cages and remains in them until they can fit out onto a shelf in-store. It is therefore crucial that we make the best possible use of the volume of these cages to keep transporting costs in control and free up storage space in a store’s warehouse. We would like you to design an algorithm in Python to fill a cage given a set of products and their dimensions.

A cage can be assumed to be perfectly cuboid with the following dimensions:  Height = 1.603m  Width = 0.697m  Length = 0.846m

Packaging dimensions and the quantities required of each product can be found in the attached file “cage_products.csv”. Products are also perfect cuboids, non-compressible (can’t be damaged/crushed) and can be freely rotated. We would like the cage filling algorithm to return:  The number of cages required to accommodate the listed products  The volume utilisation percentage of the cages (volume of products on the cage / cage’s

Product ID Height (mm) Width (mm) Length (mm) Quantity needed
1 57 80 300 1
2 326 100 100 2
3 100 100 200 1
4 50 125 80 1
5 41 100 133 1
6 300 500 400 3
7 100 100 101 1
8 57 500 300 2
9 153 268 398 1
10 112 325 157 2
11 275 320 270 1
12 400 400 600 3
13 520 400 600 1
14 60 167 100 2
15 10 10 10 1
Show what you have tried so far. We are glad to helo, but will not write it for you/
I am new to python and got this assignment to complete.
And if you write some code and tell us clearly how it is not working, we'll help you with it.