cut - # ---------------------------------------# CUTTING...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # ---------------------------------------# CUTTING STOCK USING PATTERNS # ---------------------------------------param roll_width > 0; set WIDTHS; p param orders {WIDTHS} > 0; param nPAT integer >= 0; s set PATTERNS = 1..nPAT; # width of raw rolls # set of widths to be cut # number of each width to be cut # number of patterns # set of patterns p param nbr {WIDTHS,PATTERNS} integer >= 0; check {j in PATTERNS}: sum {i in WIDTHS} i * nbr[i,j] <= roll_width; # defn of patterns: nbr[i,j] = number # of rolls of width i in pattern j var Cut {PATTERNS} integer >= 0; minimize Number: sum {j in PATTERNS} Cut[j]; # rolls cut using each pattern # minimize total raw rolls cut subject to Fill {i in WIDTHS}: sum {j in PATTERNS} nbr[i,j] * Cut[j] >= orders[i]; # for each width, total # rolls cut meets total orders # ---------------------------------------# KNAPSACK SUBPROBLEM FOR CUTTING STOCK # ---------------------------------------p param price {WIDTHS} default 0.0; v var Use {WIDTHS} integer >= 0; minimize Reduced_Cost: 1 - sum {i in WIDTHS} price[i] * Use[i]; subject to Width_Limit: sum {i in WIDTHS} i * Use[i] <= roll_width; ...
View Full Document

Ask a homework question - tutors are online