Click here to Skip to main content
15,884,388 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: 3D Points to 2D Points Pin
Ralf Meier17-Feb-18 23:02
mveRalf Meier17-Feb-18 23:02 
QuestionNode discovery in a truly decentralized system Pin
stopthespying15-Feb-18 6:40
stopthespying15-Feb-18 6:40 
AnswerRe: Node discovery in a truly decentralized system Pin
Gerry Schmitz16-Feb-18 5:21
mveGerry Schmitz16-Feb-18 5:21 
QuestionFinding strongly connected component in a directed Graph using PHP Pin
Member 136573131-Feb-18 21:22
Member 136573131-Feb-18 21:22 
QuestionA very interesting question for you all Pin
Member 1364484725-Jan-18 14:28
Member 1364484725-Jan-18 14:28 
AnswerRe: A very interesting question for you all Pin
Richard MacCutchan25-Jan-18 22:26
mveRichard MacCutchan25-Jan-18 22:26 
AnswerRe: A very interesting question for you all Pin
jschell8-Feb-18 13:33
jschell8-Feb-18 13:33 
AnswerRe: A very interesting question for you all Pin
Luc Pattyn8-Feb-18 14:59
sitebuilderLuc Pattyn8-Feb-18 14:59 
Hi,

there is no straightforward way to solve this problem. Instead, you should try different schemes and calculate how many boxes you can store in each of them, then pick the optimum.

Assuming box dimension d3 * d2 * d1 with d3>=d2>=d1, boxes are allowed to be rotated in any way and can be stacked all the way to the top, and assuming the cargo room is much longer than its diameter, this is what I would do in a first attempt, and I expect it to get really close to the absolute optimum:

- work one layer at a time, i.e. the problem gets reduced from a 3D problem to a number of much easier 2D problems;
- the first layer would have thickness d1;
- now fit as many boxes as possible in that one layer; obvious choices would be: all in long direction, or all in cross direction (the former normally being better than the latter);
- first refinement: if length of cargo room isn't a multiple of d3, you might be slightly better of splitting it (per layer!) in two parts, a big part using long direction, the remainder using cross direction;
- once the maximum is found for that layer proceed to the next layer again using thickness d1; note that the second layer has the same length but a larger width than the first layer, hence the result could be a larger number of boxes;
- continue designing your layers with thickness d1 until you reach the 45 degree angle, then the layer height should equal d2 (instead of d1), everything else remains the same;
- and once you reach the 135 degree angle, switch back to the original scheme (thickness d1).

Second refinement, somewhat more difficult: as you will probably not reach exactly 45 degrees, you might consider one less layer with thickness d1; similarly you might consider one less layer with thickness d2. This yields four cases to consider, there is a possibility one of them gives you one more layer in total, and a better solution.

Final remark: it is not sure that orthogonal filling yields the optimum, the optimum could consist of arches and other schemes that might not be practical at all, I would guess you won't care for those...

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum


modified 8-Feb-18 21:36pm.

Questionpython code on Effect of order of accuracy on the numerical differentiation Pin
Member 1362564316-Jan-18 1:32
Member 1362564316-Jan-18 1:32 
GeneralRe: python code on Effect of order of accuracy on the numerical differentiation Pin
harold aptroot17-Jan-18 23:28
harold aptroot17-Jan-18 23:28 
QuestionCompare products in Cart against min/max limitations Pin
Rico6419-Dec-17 7:07
Rico6419-Dec-17 7:07 
AnswerRe: Compare products in Cart against min/max limitations Pin
Gerry Schmitz21-Dec-17 11:04
mveGerry Schmitz21-Dec-17 11:04 
GeneralRe: Compare products in Cart against min/max limitations Pin
Rico6422-Dec-17 0:42
Rico6422-Dec-17 0:42 
AnswerRe: Compare products in Cart against min/max limitations Pin
Richard MacCutchan21-Dec-17 21:40
mveRichard MacCutchan21-Dec-17 21:40 
QuestionWriting a Sorting Algorithm -- NEED HELP! Pin
Member 135671429-Dec-17 11:36
Member 135671429-Dec-17 11:36 
AnswerRe: Writing a Sorting Algorithm -- NEED HELP! PinPopular
Gerry Schmitz10-Dec-17 1:09
mveGerry Schmitz10-Dec-17 1:09 
AnswerRe: Writing a Sorting Algorithm -- NEED HELP! Pin
Richard MacCutchan10-Dec-17 1:22
mveRichard MacCutchan10-Dec-17 1:22 
GeneralRe: Writing a Sorting Algorithm -- NEED HELP! Pin
Jc Christ5-Jun-20 1:57
Jc Christ5-Jun-20 1:57 
AnswerRe: Writing a Sorting Algorithm -- NEED HELP! Pin
Richard Deeming11-Dec-17 1:58
mveRichard Deeming11-Dec-17 1:58 
AnswerRe: Writing a Sorting Algorithm -- NEED HELP! Pin
Member 1488614010-Jul-20 3:04
Member 1488614010-Jul-20 3:04 
GeneralRe: Writing a Sorting Algorithm -- NEED HELP! Pin
Dave Kreskowiak23-Jul-20 3:39
mveDave Kreskowiak23-Jul-20 3:39 
QuestionA permutation problem Pin
Member 135615816-Dec-17 4:04
Member 135615816-Dec-17 4:04 
AnswerRe: A permutation problem Pin
Richard MacCutchan6-Dec-17 4:09
mveRichard MacCutchan6-Dec-17 4:09 
AnswerRe: A permutation problem Pin
Luc Pattyn20-Dec-17 12:03
sitebuilderLuc Pattyn20-Dec-17 12:03 
QuestionAlgorithm for insert element in compressed sparse row matrix Pin
drudox 16-Nov-17 4:23
drudox 16-Nov-17 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.