You are here: Re: Bin packing problem « PHP Programming Language « IT news, forums, messages
Re: Bin packing problem

Posted by Jerry Stuckle on 10/31/06 17:34

fraz wrote:
>>Seriously - I haven't seen anything like that in PHP. But I wouldn't
>>think it would be too hard to convert. Do you have some examples of the
>>C code?
>
>
> <a
> href="http://www.diku.dk/~pisinger/3dbpp.c">http://www.diku.dk/~pisinger/3dbpp.c</a>
>
> I have been checking out this code for the last day when I have time.
> It apparently restricts objects to not be rotatable, and the bins to
> fill are all of the same size. So, in those two respects it is not
> applicable, but I have hopes to modify it to my needs as a last resort.
> It's just a bit dense, but I didn't necessarily expect anything less
> out of the problem.
>
> One constraint though that I could throw into the mix is that I don't
> expect n (no. of items to pack) to exceed, say, 25 in all but the most
> unusual scenarios. Hence, I could get by with a hacky brute force
> heuristic that errs on the side of simpler code rather than an elegant
> algorithm that approaches a "log n" efficiency. Ultimately, I just want
> to be able to abstract the items that are to be packed so that the
> addition of new types of items doesn't throw the whole procedure and
> require a rewrite.
>
>

Yuk! Some of the worst C code I've ever seen. Virtually no comments,
meaningless single character variable names and even the function names
are cryptic. I'm sure it works - but I'd hate to have to spend the time
understanding the code. And quite frankly I'd be embarrassed to even
post it.

But back to your problem. Brute force might be the easiest way.
Figuring you have 3 different orientations of the packages (assuming
they have symmetric shapes), a recursive routine might work. And as
long as you don't have to make too many calculations it should be
relatively fast.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация