[repost due to apparent Google Groups error]
Well you seem to know what you are talking about, but i dont follow...
I think this might be beyond what i am comfortable attempting...
Dana's approach is similar to mine. So you might be uncomfortable
with my response as well. But I am able to set it up in a form that
allows for Solver to be used.
The problem with using Solver is: there are really 3 results to
minimize. They are: (1) number of raw material in 12-foot lengths;
(2) amount of scrap (see my definition below); and (3) number of
cuts. Solver can only minimize one result at a time. Presumably we
would choose #1 (number of 12-foot raw material); but that might not
minimize #2 (amount of scrap). (But see the Endnotes.)
I define "scrap" to be a length of 1 or 2 feet. Longer pieces are not
really scrap because they might be used for other projects that
require material in the same lengths, namely 3-12 feet.
I might note that with the set-up described below, it might be just as
easy (or easier!) to find the optimal solution manually by trial-and-
error.
My set-up is quite complicated to describe. It would be easier to
send you the Excel file. Feel free to send me email for that.
Needless to say, there is nothing sacrosant about my choice of cells
to use. You might prefer a very different layout. That said, here
goes....
Let B1:B10 represent the required number of 12-, 11-,..., 3-foot
lengths. These are cells in which you enter your requirements.
The following cells will contain the number of each indicated pattern
(with the amount of scrap in parentheses). These are the Solver
variables ("by changing cells"), which we want to vary to find an
optimal solution. Usually, it is prudent to blank these cells each
time before using Solver.
E1: 9+3
G1: 8+4
G2: 8+3 (1)
I1: 7+5
I2: 7+4 (1)
I3: 7+3 (2)
K1: 6+5 (1)
K2: 6+4 (2)
K3: 6+3+3
M1: 5+5 (2)
M2: 5+4+3
M3: 5+3+3 (1)
O1: 4+4+3 (1)
O2: 4+3+3 (2)
Q1: 3+3+3+3
As you might imagine, the gaps between columns are used for
descriptive labels.
The following cells compute the sum of the number of each cut length
produced by the solution. The summation cells are used to specify the
Solver constraints.
#9: E4: =sum(E1:E3)
#8: G4: =sum(G1:G3)
#7: I4: =sum(I1:I3)
#6: K4: =sum(K1:K3)
7+5: E7: =I1
6+5: E8: =K1
5+5: E9: =M1
5+4+3: E10: =M2
5+3+3: E11: =M3
#5: E16: =sum(E7:E15,E9)
8+4: G7: =G1
7+4: G8: =I2
6+4: G9: =K2
5+4+3: G10: =M2
4+4+3: G11: =O1
4+3+3: G12: =O2
#4: G16: =sum(G7:G15,G11)
9+3: I7: =E1
8+3: I8: =G2
7+3: I9: =I3
6+3+3: I10: =K3
5+4+3: I11: =M2
5+3+3: I12: =M3
4+4+3: I13: =O1
4+3+3: I14: =O2
3+3+3+3: I15: =Q1
#3: I16: =sum(I7:I15,I10,I12,I14,3*I15)
B14 computes the total number of 12-foot raw material. That is the
"target cell" for Solver. B15 computes the amount of scrap. B16
computes the number of cuts. The formulas are:
B14: =SUM(B1:B3,E1,G1:G2,I1:I3,K1:K3,M1:M3,O1:O2,Q1)
B15: =B2+G2+I2+K1+M3+O1+ 2*(B3+I3+K2+M1+O2)
B16: =SUM(B2:B3,E1,G1:G2,I1:I3,K1:K2,M1) + 2*SUM(K3,M2:M3,O1:O2) +
3*Q1
Whew! Now for the Solver set-up....
Target Cell:
$B$14, Min
By Changing Cells:
$E$1, $G$1:$G$2, $I$1:$I$3, $K$1:$K$3, $M$1:$M$3, $O$1:$O$2, $Q$1
Constraints:
$E$1 = integer
$E$16 >= $B$8
$E$4 >= $B$4
$G$16 >= $B$9
$G$1:$G$2 = integer
$G$4 >= $B$5
$I$16 >= $B$10
$I$1:$I$3 = integer
$I$4 >= $B$6
$K$1:$K$3 = integer
$K$4 >= $B$7
$M$1:$M$3 = integer
$O$1:$O$2 = integer
$Q$1 = integer
HTH.
Endnotes:
1. After using Solver with B14 as the Target Cell, change the Target
Cell to B15 and click on Solve again, __without__ blanking the
variable cells in E1:Q3. This might improve the solution with the
additional goal of minimizing the amount of scrap.
2. Note that the constraints are ">=" instead of "=". If you used
"=", Solver usually might not find a solution with integer values in
the variables. Solver will silently use non-integers.
3. There may be multiple optimal solutions. Solver merely finds one.
There may be subjective reasons for you to choose one of the other
optimal solutions -- or even a non-optimal solution. I think it is
best to think of the Solver result as a starting point, not
necessarily a final answer.
4. I am a Solver neophyte. Experts might weigh in with improvements
or a completely different and better approach.