Hi there,
You set a really difficult question.
Our Shipping Table Rates extension can be useful for you.
Recently, we have updated one of the features it has. Now you can use a volumetric weight calculation to set your shipping rate. This is a pricing method, that takes account of the length, width, and height of a package. You can use it to optimize the usage of the box space more efficiently. You can learn more about Shipping Table Rates extension from the product page.
We hope it was helpful for you.