M
M
muhasa2019-02-11 23:36:18
Algorithms
muhasa, 2019-02-11 23:36:18

How to add up the volume of goods in an order?

In short, they asked to connect the delivery module to the online store. Connected. But now there's a problem. Let's imagine that there are 3 products in the order with sizes - 10*10*10, 20*20*20 and 30*30*30. There are a number of combinations that allow you to arrange these items in a box. As a result, how to optimally calculate the final volume of the parcel?
Obviously, this task is simpler and can be solved without any combinatorial algorithms by some kind of life hack. Who does what? It’s just that we have jackets, this is more of a voluminous product than a heavy one, I think the volume will come to the fore
UPD
Guys, in any case, is there some kind of php library that does this? Can you tell me?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alex-1917, 2019-02-14
@alex-1917

we mostly have jackets

you are fooling yourself.
You don’t need to imagine anything, outerwear generally leaves in one size of the package, drive in one size of the box and everything is short-lived. I have been trading clothes for 25 years ...
Or look at how business lines are counted when you add a second load - as they said above, the stupid coefficient is all!
And the task of optimal placement of different boxes is actually fucking complicated, your server will only be engaged 24 hours a day in the optimal arrangement of these boxes of yours ...
The less freedom the buyer has, the faster the loot arrives from him ...

A
Antonio Solo, 2019-02-12
@solotony

the empirical formula sum *1.5 was guaranteed to work. in furniture

A
Andrey Tsvetkov, 2019-02-13
@yellow79

Very similar to the classic knapsack problem, its optimal solution is not as primitive as it might seem.
https://ru.m.wikipedia.org/wiki/Task_about_backpack

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question