[Lazarus] Lazarus installation on Mac plus other thoughts

Juha Manninen juha.manninen62 at gmail.com
Thu Jul 29 09:45:48 CEST 2010


2010/7/27 Cox, Stuart TRAN:EX <Stuart.Cox at gov.bc.ca>

> As a matter of interest, are you using some form of the Bin Packing or
> Knapsack algorithms to underpin your woodworking program?
>

I think so yes. Only the knapsack weights must be <= a given value, the wood
board lengths must be >= the value. Otherwise the same probmem. (Just found
those from wikipedia.)

There is a Cardinal holding the number of possible combinations. It works as
a bit mask when lengths are added. It means the max number of boards is 32
now but could be extended to 64 using QWord (or int64). The calculation time
raises exponentially of course.

My code is no secret so I include it here as
Ohjelma.tar.gz<?ui=2&ik=fd78cd74df&view=att&th=12a1d2748f6002f3&attid=0.1&disp=attd>.
The UI is in Finnish and is very primitive. I can translate it if someone is
interested. Input numbers are on left, one per line, then the wanted value
and then a Calculate-button.

I made few optimizations, 2 combinations are counted on one round and an
exact match stops the search. This would be a PERFECT candidate for a
multithreaded program. Not much data is transferred so the threads would not
block each other.


Ministry of Transportation and Infrastructure
>

Now I understand. The Knapsack problem and Bin Packing often comes up when
doing transportation. :-)


Regards,
Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100729/2d59c732/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ohjelma.tar.gz
Type: application/x-gzip
Size: 4708 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100729/2d59c732/attachment-0004.bin>


More information about the Lazarus mailing list