Practical Combinatorial Optimization software
A quick and handy tool for a class of knapsack problems
SizeFitter 4.0 has been uploaded. Tidier and easier to understand data management. Twice as fast as earlier versions. This was actually year 2003; no bugs have been found or reported since. SizeFitter is now a classical software tool. WinSite , VersionTracker , CADalog , CADdepot , Tucows and CNET in no particular order. Please review it at the sites! This version is a 30 days restricted trial. SizeFitter Promotion: Full unlimited version free! Please email me ceo@sizefitter.com for a permanent unrestricted key to SizeFitter for free. Include "SizeFitter" in subject line. No, I don't harvest email addresses, just like feedback if the program is useful.

The problem
Suppose that you are planning to use a range of standard elements for a construction, and the sum of the elements has to add up to a desired length. The construction can be almost anything you have in mind, e.g. a wall or a facade. How would you select the optimal quantity of each standard unit? Take as an example the following range of units for the completion of a target length of  54 ft 6".

Unit No
1
2
3
4
5
6
Sizes"
8 3/4
11 1/4
14 3/4
21 1/2
30 1/4
45 3/4
Prices
11.95
14.95
19.95
26.95
39.95
54.95

It is preferable that the units should add up to the desired total length of 654 inches, but working just this out is a difficult hit-and-miss task as there are millions of combinations to try out. The economically minded would like to make sure that the solution is the cheapest possible, but the cheapest solution in this case consist of 14 pieces of unit No. 6 and one piece of unit No. 3, totaling £789.25. But inevitably this solution leaves a surplus length of  1".25 that would need to be shaved off and this may spoil the finish.

The solution
We could also go through all the combinations that fit exactly, not a bad idea, but there are 9283 combinations that fit the length exactly, some up to £100 more expensive. The best solution can be found using Multi Objective Optimization. SizeFitter does this and finds the answer in no time at all. SizeFitter has a choice of Primary and Secondary Objectives. Here is a screen shot of what's going on. To see the result here, just click on the picture below to enlarge and then click on the Multi Objective tab.

       

The Multi-Objective solution is Pareto optimal for the two criteria, but this just means that you can't improve on both criteria at the same time. The above mentioned minimum cost solution is unique for the objective. However when going for the 'best fit', there are multiple solutions with the same optimal fit, but with different costs, hence there is an opportunity to move onto the Pareto efficient frontier, that's what has happened here.

Now you can also play with the bounds: Suppose there were only 12 of unit No. 6 in stock. Would the cheapest solution then result in an exact fit? The answer is still "no". That would have resulted in a cost of £794.10, but with 1" excess misfit. You can play with the bounds interactively. If the bound on unit No. 6 is lowered still further, the optimal quantities of the other units begins to go up. Then you can tighten those as well and see the result directly. Here is also an investment example.

The algorithm uses highly efficient searches and gives exact solutions; at this point I must emphasize that SizeFitter is not a heuristic. You will be genuinely surprised by the speed of this optimizer. It is often the small scale combinatorial problems that puts you in a tight corner as the discrete nature becomes more apparent, hence the importance of their quick and handy solutions.

There may be many knapsack solvers on the internet, but this program has a unique combination of optimization from above/below target, optional bounds, multi-objective option, report generation, exactness and speed, but is very user friendly. The three available panes runs in independent threads, hence the Store/Recall buttons for transfer of context. SizeFitter is compiled for Windows XP, Pentium or higher. However, it also runs on Windows 98,ME,NT,2000.

Now also featured at the Danish engineering site Ingeniøren|net
"A smart little program that can optimise the use of materials. Briefly, you type in a desired target (e.g. weight or length). Then you type the lengths/weights and optionally the prices of the materials and how many there are available. The program then calculates the best use of the materials. Smart and easy to use."

User information
To run the above problem: Select the Multi Objective pane, click on 'Casefile' from the top menu and open the file: C:\program files\JHAndersen\SizeFitter 4.0\problem1.txt

Project Assistance
Available for Operational Research, Optimisation, Simulation Modelling, Numerical & Statistical Analysis. Consultancy or project work. Covering a range of technologies; FORTRAN, C++Builder, C#, XML. Very reasonable daily rates. contact me or tel. 07501308405 (UK) to discuss your requirements.
Johannes H Andersen