0% found this document useful (0 votes)
26 views22 pages

2D Cutting Stock Problem

different ways of approaching 2d cutting stock problems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views22 pages

2D Cutting Stock Problem

different ways of approaching 2d cutting stock problems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

VIETNAM NATIONAL UNIVERSITY, HO CHI MINH CITY

UNIVERSITY OF TECHNOLOGY
FACULTY OF COMPUTER SCIENCE AND ENGINEERING

HO CHI MINH CITY, DATE: 15/12/2024

MATHEMATICAL MODELING (CO2011)

Assignment

“2D Cutting Stock Problem”

Instructor(s): Mr. Le Hong Trang

Students (Group 80): Hà Tường Nguyên - 2250013 (CC06, Leader)


Trịnh Đức Sơn - 2353056 (CC06)
Nguyễn Hiền Minh - 2352750 (CC05)
Hoàng Thị Thanh Tâm - 2252731 (CC06)
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Contents
1 Acknowledgements 3

2 Introduction 3
2.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Cutting Stock Problem . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Column Generation Algorithm . . . . . . . . . . . . . . . . . . . . . 4
2.4 Genetic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 Greedy Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Modeling the Cutting Stock Problem 7


3.1 Greedy Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.1 What is Greedy Algorithm? . . . . . . . . . . . . . . . . . . 8
3.1.2 Greedy Algorithm for 2D-CSP . . . . . . . . . . . . . . . . . 8
3.1.3 Example Problem . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.4 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 Genetic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.1 What is Genetic Algorithm? . . . . . . . . . . . . . . . . . . 10
3.2.2 Flow chart for Genetic Algorithm steps . . . . . . . . . . . . 10
3.2.3 Problem Description . . . . . . . . . . . . . . . . . . . . . . 11
3.2.4 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.5 Problem Overview . . . . . . . . . . . . . . . . . . . . . . . 12
3.2.6 Genetic Algorithm Steps . . . . . . . . . . . . . . . . . . . . 12
3.2.7 Example Application . . . . . . . . . . . . . . . . . . . . . . 13
3.2.8 Example Application . . . . . . . . . . . . . . . . . . . . . . 14
3.3 Column Generation Algorithm . . . . . . . . . . . . . . . . . . . . . 15
3.3.1 What is Column Generation Algorithm? . . . . . . . . . . . 15
3.3.2 Flow chart for Column Generation Algorithm steps . . . . . 16
3.4 2D Cutting Stock Problem . . . . . . . . . . . . . . . . . . . . . . . 16
3.4.1 Problem Description . . . . . . . . . . . . . . . . . . . . . . 16
3.4.2 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 Conclusion 20

5 Analyze Results 20

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 1/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

No. Name Student ID Class % Done


1 Hà Tường Nguyên 2250013 CC06 100%
2 Trịnh Đức Sơn 2353056 CC06 100%
3 Nguyễn Hiền Minh 2352750 CC05 100%
4 Hoàng Thị Thanh Tâm 2252731 CC06 100%

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 2/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

1 Acknowledgements
We would like to extend our heartfelt gratitude to Mr. Le Hong Trang, our
Math Modeling lecturer, for his invaluable support and guidance throughout this
project. His readiness to address our questions and provide clear explanations
greatly contributed to the successful completion of our research. His dedication
and passion as an educator have been pivotal, offering not only technical insights
but also meaningful life lessons that have enriched our learning experience. The
project owes much of its success to his unwavering support and thoughtful advice.
Additionally, we deeply appreciate the collaboration and efforts of all team
members as well as our classmates. Their commitment and contributions at every
stage of the research were crucial in bringing this project to fruition. It has been
a privilege to work alongside such dedicated teammates and friends.

2 Introduction
Column Generation (CG) is an efficient method for solving large-scale lin-
ear programming problems with a massive number of variables. This method is
commonly applied in optimization problems in industries such as manufacturing,
logistics, or transportation, where solving the entire problem directly is infeasible
due to the sheer number of variables.
The Column Generation technique operates based on the idea of generating
only those variables (columns) that can improve the solution of the main problem
(master problem), rather than handling all variables simultaneously. This approach
saves memory and computation time while ensuring feasibility even for large-scale
problems.

2.1 History
The Cutting Stock Problem (CSP) was first formulated as an integer pro-
gramming problem in 1939 by Kantorovich. However, due to limitations such as
weak continuous relaxation and symmetry, its application in real-world scenar-
ios was initially ineffective. In 1951, Leonid Vitalyevich Kantorovich and Victor
Abramovich Zalgaller proposed a solution using integer linear programming. Over
the years, this model has continued to attract attention from the scientific commu-
nity and has been constantly refined. The problem has been proven to belong to
the NP-hard class, implying high computational complexity that prevents finding
a general solution in polynomial time.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 3/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

2.2 Cutting Stock Problem


The one-dimensional Cutting Stock Problem (1D-CSP) is a renowned NP-
hard problem in manufacturing processes across industries such as steel, garment,
and aluminum. This problem has garnered significant attention from computer
scientists in recent years.
The classical 1D-CSP involves cutting fixed-length material bars into smaller
segments with specified lengths while minimizing leftover waste. This optimization
process is crucial in reducing material costs and increasing efficiency in production.
The 2D Cutting Stock Problem involves cutting large sheets, such as metal
plates or wooden boards, into smaller rectangles to meet demand. Similar to the
1D problem, the objective is to minimize the number of sheets used while fulfilling
all demands.

Mathematical Formulation

Let the dimensions of the stock sheet be W × H, and let the requested
rectangles have dimensions wi × hi with corresponding demands di .

Decision Variables:

• xj : The number of sheets used according to pattern j.


• aij : The number of times rectangle wi × hi appears in pattern j.

Constraints:
X
aij xj ≥ di , ∀i = 1, . . . , n
j
X
wi hi aij ≤ W × H, ∀j
i

Objective Function:

Minimize the total number of sheets used:


X
min xj
j

2.3 Column Generation Algorithm


Column generation is a decomposition-based approach for solving large-scale
linear programming problems efficiently by focusing on a subset of decision vari-
ables (columns). Instead of considering all variables at once, the algorithm itera-
tively generates new variables that have the potential to improve the solution. This

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 4/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

approach is particularly effective for problems with a huge number of variables,


such as vehicle routing, crew scheduling, and cutting stock problems.
Key Steps:
• Restricted Master Problem (RMP): Solve a reduced version of the original
problem with only a subset of the variables (columns).
• Pricing Problem: Identify new variables (columns) with negative reduced costs
by solving a subproblem (pricing problem).
• Column Addition: Add the newly generated columns to the RMP and resolve
it iteratively until no columns with negative reduced costs exist.
Advantages:
• Efficiently handles problems with a large number of variables by focusing only
on relevant columns.
• Iterative nature allows for gradual refinement of the solution without solving
the full problem upfront.
• Reduces memory requirements as only a subset of variables is actively used
in the RMP at any iteration.
• Easily integrates with branch-and-bound methods to solve integer program-
ming problems.
Disadvantages:
• Requires a well-designed pricing problem to identify useful columns effectively.
• Computationally expensive for complex pricing subproblems, especially in
non-linear or combinatorial cases.
• Convergence may be slow if the initial set of columns is not well-chosen or if
the problem is poorly structured.
• Additional implementation complexity compared to straightforward linear
programming methods.
Column generation is a highly effective algorithm for large-scale optimization
problems where the total number of decision variables makes solving the full model
computationally infeasible. By iteratively focusing only on promising variables, it
significantly reduces the problem size while maintaining solution accuracy.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 5/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

2.4 Genetic Algorithm


A Genetic Algorithm (GA) is a search and optimization technique inspired by
the principles of natural selection and genetics, first introduced by John Holland in
the 1970s. GAs are widely used to solve complex optimization problems in various
fields, including engineering, finance, and artificial intelligence.
Key Components of Genetic Algorithm:
• Chromosome Representation: Each solution is represented as a chromosome,
typically as a binary string, integer array, or real-valued vector.
• Population: A group of chromosomes that evolves over iterations (genera-
tions).
• Fitness Function: Evaluates the quality of each solution based on the prob-
lem’s objectives.
Genetic Operators:
• Selection: Chooses the best individuals from the population based on fitness
scores for reproduction.
• Crossover: Combines two parent solutions to produce offspring.
• Mutation: Introduces random changes in offspring to maintain genetic diver-
sity.
• Termination Condition: The algorithm stops when a predefined condition
is met, such as reaching a maximum number of generations or achieving a
satisfactory fitness level.
Advantages:
• Robustness: GAs can solve complex and non-linear optimization problems
that traditional optimization methods might struggle with.
• Global Search Capability: GAs are less likely to get stuck in local optima
compared to gradient-based methods.
• Flexibility: They can handle various types of objective functions and con-
straints without requiring gradient information.
Disadvantages:
• Computational Cost: GAs are often computationally expensive due to the
need to evaluate a large population over many generations.
• Parameter Sensitivity: The performance of GAs heavily depends on the proper
tuning of parameters like population size, crossover probability, and mutation
rate.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 6/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

• No Guarantee of Optimality: GAs may not always find the global optimum,
especially when the search space is vast or fitness landscapes are highly com-
plex.

2.5 Greedy Algorithm


The greedy algorithm is a heuristic approach that iteratively makes locally
optimal choices with the aim of finding a global optimum. In the context of the
2D cutting stock problem, the greedy algorithm selects items or patterns to cut
based on criteria such as maximizing material utilization or minimizing waste at
each step. It proceeds by solving the problem one piece at a time, considering only
the immediate impact of the current decision.
This approach is straightforward and fast, but it does not guarantee finding
the global optimum due to its focus on immediate gains rather than long-term
outcomes.
• Selects pieces or patterns to cut based on maximizing material usage or min-
imizing waste.
• Progresses iteratively, solving for one piece at a time.
Advantages:
• Simple and easy to implement.
• Computationally efficient, especially for small or moderately sized problems.
• Can provide a quick feasible solution that can be used as a starting point for
more complex methods.
Disadvantages:
• Often results in suboptimal solutions due to its local optimization focus.
• May not explore enough of the solution space to avoid poor decisions early in
the process.
• Less effective for problems with complex constraints or large solution spaces.

3 Modeling the Cutting Stock Problem


Introduction
The Cutting Stock Problem (CSP) arises in industries where large raw materi-
als must be cut into smaller pieces to meet specific demands. This optimization
problem is common in manufacturing, logistics, and production planning. CSP is
classified into:

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 7/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

• 1D Cutting Stock Problem: Cutting long stock materials into smaller


segments.
• 2D Cutting Stock Problem: Cutting rectangular stock materials into
smaller rectangles.
The objective is to minimize the total number of raw materials used while satisfying
demand. This document employs Genetic Algorithm (GA) to solve 2D variants
efficiently.

3.1 Greedy Algorithm


3.1.1 What is Greedy Algorithm?

A greedy algorithm is a problem-solving approach that builds a solution


incrementally by making the most favorable choice at each step, based on a specific
heuristic. It does not revisit previous choices, aiming for local optimization at each
stage, which often leads to a globally optimal solution. While greedy algorithms
are efficient and simple, they are not guaranteed to find the optimal solution for
all problems. However, they work well for problems that exhibit the greedy-choice
property and optimal substructure.

3.1.2 Greedy Algorithm for 2D-CSP

The greedy algorithm solves the 2D-CSP by iteratively selecting and placing
items based on a specific heuristic, such as maximizing material utilization or
minimizing waste for each cut. The basic steps of the algorithm are:
1. Sort the items based on a heuristic (e.g., decreasing order of area or aspect
ratio).
2. Start with an empty stock sheet.
3. Place items sequentially using the "first-fit"strategy, ensuring no overlaps and
adherence to stock dimensions.
4. When an item cannot fit on the current stock, allocate a new stock sheet.
5. Repeat until all items are placed.

3.1.3 Example Problem

To illustrate the greedy algorithm, consider the following example:

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 8/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Problem Description

You have stock sheets of size 10 × 10 units. The items to cut are as follows:
• Item 1: 4 × 6
• Item 2: 3 × 5
• Item 3: 6 × 4
• Item 4: 2 × 7
• Item 5: 5 × 3
The objective is to minimize the number of stock sheets used.

Solution:

Step 1: Sort Items Items are sorted by area in descending order:


• Item 3: 6 × 4 (24 units)
• Item 1: 4 × 6 (24 units)
• Item 2: 3 × 5 (15 units)
• Item 5: 5 × 3 (15 units)
• Item 4: 2 × 7 (14 units)

Step 2: Placement on Stock Sheets The algorithm places items sequentially:

1. Stock Sheet 1: Place Item 3 and Item 1.


2. Stock Sheet 2: Place Item 2, Item 5, and Item 4.

3.1.4 Results

Stock Sheet 1:

• Place Item 3 (6 × 4) in the top-left corner.


• Place Item 1 (4 × 6) to the right of Item 3.
• Remaining space: 6 × 6 below the items.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 9/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Stock Sheet 2:

• Place Item 2 (3 × 5) in the top-left corner.


• Place Item 5 (5 × 3) to the right of Item 2.
• Place Item 4 (2 × 7) below Item 2.
• Remaining space: 3 × 7.
Using the greedy algorithm, the problem is solved with two stock sheets. The
placements result in minimal waste.

3.2 Genetic Algorithm


3.2.1 What is Genetic Algorithm?

The Genetic Algorithm (GA) is an optimization technique inspired by the process


of natural selection in biological evolution. It is particularly effective for solving
complex problems with large search spaces by iteratively improving a population
of solutions.
Key Concepts:
• Population: A set of candidate solutions.
• Chromosome: A representation of a solution.
• Fitness Function: Evaluates the quality of a solution.
• Genetic Operators: Includes selection, crossover, and mutation.

3.2.2 Flow chart for Genetic Algorithm steps

Figure 1: flow chart outlines for the main algorithmic steps

The GA process consists of the following steps:

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 10/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

1. Initialization: Generate an initial population of solutions randomly.


2. Evaluation: Calculate the fitness of each solution.
3. Selection: Choose parent solutions based on fitness.
4. Crossover: Combine pairs of parents to produce offspring.
5. Mutation: Randomly alter offspring to maintain diversity.
6. Replacement: Form the next generation by replacing the least fit solutions.
7. Termination: Stop when a convergence criterion is met (e.g., reaching a fixed
number of iterations or a target fitness value).

3.2.3 Problem Description

The 2D CSP generalizes the 1D problem to rectangular stock materials. Let:


• W, H: Width and height of the stock material.
b1
 
 b2 
• b=  ... : Demand vector, where bi is the required number of pieces of size

bm
wi × hi .
• A: Cutting pattern matrix, where aij represents the number of pieces of type
i in pattern j.

3.2.4 Objective

The goal is to minimize the total number of stock sheets used to meet the demand
for all piece types while minimizing waste. Let:
• xj : Number of stock sheets used for cutting pattern j.
• aij : Number of pieces of type i that can be cut in pattern j.
• bi : Demand for pieces of type i.
Objective:
n
X
Minimize z = xj
j=1
Subject to:
n
X
aij xj ≥ bi ∀i = 1, 2, . . . , m
j=1
xj ≥ 0 and integer ∀j = 1, 2, . . . , n
Here, z represents the total number of stock sheets used.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 11/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

3.2.5 Problem Overview

The goal is to minimize the number of large sheets (stocks) required to cut smaller
pieces (pieces) according to specified dimensions and demands. This is achieved
by evolving cutting patterns through a Genetic Algorithm (GA).

3.2.6 Genetic Algorithm Steps

Step 1: Chromosome Representation


Each chromosome encodes a cutting pattern:
c = [a11 , a12 , . . . , a1n , . . . , amn ]

Where aij is the count of type-i pieces in pattern-j.


Step 2: Initial Population
Randomly generate P feasible patterns satisfying:
m
X
wi hi aij ≤ W H ∀j
i=1

ensuring stock size limits.


Step 3: Fitness Function
The fitness function evaluates the quality of patterns:
1
Fitness(c) =
1 + Waste(c)
where Waste(c) is the unused stock area.
Step 4: Selection
Select parent chromosomes for reproduction using:
• Roulette Wheel Selection: Higher fitness increases selection probability.
• Tournament Selection: Select the fittest among k random chromosomes.
Step 5: Crossover
Combine parent chromosomes to generate offspring:
• One-Point Crossover: Swap segments at a random point.
• Uniform Crossover: Randomly exchange genes.
Step 6: Mutation
Introduce diversity by modifying genes:
• Randomly adjust aij values.
• Create new feasible patterns.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 12/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Step 7: Replacement
Replace the least fit chromosomes with new offspring.
Step 8: Termination
Stop the algorithm when a criterion is met:
• Fixed number of generations.
• Fitness value convergence.
Step 9: Decoding the Solution
The fittest chromosome represents the optimal cutting patterns and the total num-
ber of stock sheets required.

3.2.7 Example Application

Stock and Pieces

• Stock dimensions: W = 10, H = 10.


• Piece types:
– Type 1: w1 = 4, h1 = 4, demand d1 = 2.
– Type 2: w2 = 3, h2 = 3, demand d2 = 3.
Initialized Patterns

• Pattern 1: Two Type-1 pieces.


• Pattern 2: Three Type-2 pieces.
• Pattern 3: One Type-1 and two Type-2 pieces.
Optimization Results

• Total stock sheets: 2 (rounded up).


• Pattern distribution:
– Pattern 1: Used once.
– Pattern 2: Not used.
– Pattern 3: Used twice.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 13/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

3.2.8 Example Application

Input:
• Stock sheet size: W = 10, H = 10.
• Piece types:
– Type 1: w1 = 4, h1 = 4, b1 = 2 (demand: 2 pieces).
– Type 2: w2 = 3, h2 = 3, b2 = 3 (demand: 3 pieces).
Initial Population: Randomly generate feasible patterns that fit the stock
sheet constraints. Example initial patterns:
• Pattern 1: [2, 0] (2 pieces of Type 1, no Type 2).
• Pattern 2: [0, 3] (no Type 1, 3 pieces of Type 2).
• Pattern 3: [1, 2] (1 piece of Type 1, 2 pieces of Type 2).
• Pattern 4: [0, 4] (no Type 1, 4 pieces of Type 2, waste space).
Chromosome Representation: Each chromosome encodes a combination of
patterns. For example:

Chromosome = {[2, 0], [0, 3]}


This chromosome indicates that:
• Pattern 1 is used once.
• Pattern 2 is used once.
Fitness Evaluation: The fitness function evaluates each chromosome by con-
sidering:
• Total waste: Unused space on stock sheets.
• Penalty for unmet demand: A large penalty is added for failing to meet the
demand b1 or b2 .
For example:
1
Fitness =
Total Waste + Penalty
Iterations:
• Generation 1:
– Chromosome 1: {[2, 0], [0, 3]} (2 stocks used, no waste, fitness = high).
– Chromosome 2: {[1, 2], [1, 2]} (2 stocks used, some waste, fitness = medium).

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 14/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

– Chromosome 3: {[0, 4], [1, 2]} (2 stocks used, high waste, fitness = low).
• Selection: Choose the best-fit chromosomes (e.g., Chromosome 1 and Chro-
mosome 2) for crossover.
• Crossover: Combine parts of Chromosome 1 and Chromosome 2 to create
new offspring:
Offspring = {[2, 0], [1, 2]}
• Mutation: Randomly modify a pattern in the offspring to maintain diversity.
For example:
Mutated Offspring = {[2, 0], [0, 3]}
• Replacement: Replace the least fit chromosomes with the offspring.
Output: After multiple generations, the Genetic Algorithm finds an optimal
solution:
• Optimal patterns:
– Pattern 1: [2, 0] (2 pieces of Type 1 per stock).
– Pattern 3: [1, 2] (1 piece of Type 1 and 2 pieces of Type 2 per stock).
• Total stocks used: 2 (1 stock for Pattern 1 and 1 stock for Pattern 3).
• Waste: Minimal (e.g., only a few units of unused space on each sheet).

3.3 Column Generation Algorithm


3.3.1 What is Column Generation Algorithm?

The Column Generation Algorithm is an optimization technique used to


solve large-scale linear programming (LP) problems, particularly in cases where
the number of variables (columns) is prohibitively large to consider explicitly. It
iteratively improves the solution by dynamically generating and adding only the
most promising variables to the restricted problem.
Key Concepts:
• Master Problem (MP): A restricted version of the original LP problem
with only a subset of variables.
• Pricing Problem (PP): A subproblem that identifies new variables (columns)
with the potential to improve the solution.
• Reduced Cost: Determines whether a new column should be added based
on its contribution to the objective function.
• Convergence: Achieved when no column with negative reduced cost exists.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 15/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Figure 2: Flow chart outlining the main steps of the Column Generation Algorithm

3.3.2 Flow chart for Column Generation Algorithm steps

The Column Generation process consists of the following steps:


1. Initialization: Solve a restricted master problem (RMP) using a small subset
of variables (columns).
2. Evaluation of Reduced Costs: Compute the reduced costs for all potential
columns using dual variables from the RMP.
3. Pricing Problem: Solve the pricing problem to identify a column with neg-
ative reduced cost (for minimization problems).
4. Column Addition: Add the identified column to the RMP.
5. Solve RMP: Resolve the RMP with the updated set of columns.
6. Termination: Stop if no columns with negative reduced cost are found; oth-
erwise, return to Step 2.

3.4 2D Cutting Stock Problem


3.4.1 Problem Description

The 2D CSP generalizes the 1D problem to rectangular stock materials. Let:


• W, H: Width and height of the stock material.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 16/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

b1


 b2 
• b=
 ... : Demand vector, where bi is the required number of pieces of size

bm
wi × hi .
• A: Cutting pattern matrix, where aij represents the number of pieces of type
i in pattern j.

3.4.2 Objective

The goal is to minimize the total number of stock sheets used to meet the demand
for all piece types while minimizing waste. Let:
• xj : Number of stock sheets used for cutting pattern j.
• aij : Number of pieces of type i that can be cut in pattern j.
• bi : Demand for pieces of type i.
Objective:
n
X
Minimize z = xj
j=1

Subject to:
n
X
aij xj ≥ bi ∀i = 1, 2, . . . , m
j=1

xj ≥ 0 and integer ∀j = 1, 2, . . . , n
Here, z represents the total number of stock sheets used.

Applying Column Generation to the 2D Cutting Stock Problem


Problem Overview

The goal is to minimize the number of large sheets (stocks) required to


cut smaller pieces (patterns) that meet specified dimensions and demands. The
Column Generation Algorithm dynamically generates cutting patterns with the
potential to improve the solution, instead of enumerating all possible patterns
upfront.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 17/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Column Generation Steps

Step 1: Master Problem (MP)


The master problem (MP) is a restricted linear programming (RMP) model that
considers only a subset of feasible cutting patterns. Its objective is:
X
Minimize xj
j

subject to: X
aij xj ≥ di , ∀i = 1, . . . , m
j

xj ≥ 0, ∀j
where: - xj is the number of times pattern-j is used. - aij is the number of pieces
of type-i in pattern-j. - di is the demand for piece type-i.
Step 2: Pricing Problem (PP)
The pricing problem generates new patterns (columns) that can potentially reduce
the overall cost. The subproblem for each stock sheet maximizes the reduced cost:
X
Maximize π i ai
i

subject to: X
wi hi ai ≤ W H, ai ≥ 0 and integer.
i
Here: - πi are the dual prices of the MP. - wi , hi are the dimensions of piece type-i.
- W H is the area of the stock sheet.
If the reduced cost of the solution is negative, the corresponding pattern is
added to the RMP.
Step 3: Initialization
Solve the RMP using a small subset of feasible patterns (e.g. simple patterns with
a single or a few types of pieces). Obtain dual prices πi for the constraints of the
solution.
Step 4: Solve Pricing Problem
Use dual prices πi to solve the pricing problem and identify new cutting patterns
with negative reduced cost. This step can be solved using a **Knapsack Problem**
approach.
Step 5: Add New Columns
If new patterns are identified, add them to the RMP and resolve it. Update the
solution and dual prices.
Step 6: Termination
The algorithm terminates when no new pattern with negative reduced cost can
be found, indicating that the optimal solution to the master problem has been
reached.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 18/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Example Application

Stock and Pieces:


• Stock dimensions: W = 10, H = 10.
• Piece types:
– Type 1: w1 = 4, h1 = 4, demand d1 = 2.
– Type 2: w2 = 3, h2 = 3, demand d2 = 3.
Step 1: Initialization
Start with simple patterns:
• Pattern 1: [2, 0] (2 pieces of Type 1, no Type 2).
• Pattern 2: [0, 3] (no Type 1, 3 pieces of Type 2).
• Pattern 3: [1, 2] (1 piece of Type 1, 2 pieces of Type 2).
Solve the RMP with these initial patterns.
Step 2: Pricing Problem
Using the dual prices π1 and π2 of the RMP, solve the pricing problem to find a
new cutting pattern. For example:
Maximize 4π1 + 9π2

subject to:
4a1 + 3a2 ≤ 10, a1 , a2 ≥ 0 and integer.
If the solution yields a1 = 0, a2 = 3, a new pattern [0, 3] is identified.
Step 3: Add New Pattern
Add the new pattern to the RMP and resolve it.
Step 4: Iterate
Repeat the process of solving the RMP, updating the dual prices, solving the
pricing problem, and adding new patterns until no pattern with negative reduced
cost is found.
Optimal Solution:
After several iterations, the final solution includes:
• Pattern 1: [2, 0] used once.
• Pattern 3: [1, 2] used once.
Result: The total number of stock sheets required is 2, with minimal waste.

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 19/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

4 Conclusion
The simplicity of the greedy algorithm allows for quick solutions to the 2D-CSP.
However, it may not produce the optimal solution in all cases due to its myopic
nature. Advanced techniques, such as genetic algorithms or dynamic program-
ming, could potentially improve the results at the cost of increased computational
complexity.
By systematically exploring the solution space using the Column Generation
Algorithm, efficient cutting patterns are identified that minimize trim loss while
satisfying all demands. This approach is particularly effective for large-scale prob-
lems, offering robust and scalable solutions that are adaptable to diverse real-world
scenarios.

5 Analyze Results
We compare four algorithms: two from the given (Greedy and Random) and two
from our group (Greedy - Policy1 and Column Generation - Policy2). The evalu-
ation is conducted using the following settings:

• Seed: 0 to 9
• Epoch: 100

Algorithm Average Trim Loss


Greedy 0.374
Random 0.8603
Greedy (Policy1) 0.2896
Column Generation (Policy2) 0.1333

Table 2: Average Trim Loss

Algorithm Average Time (s)


Greedy 18.253
Random 0.220
Greedy (Policy1) 57.380
Column Generation (Policy2) 35.187

Table 3: Average Time

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 20/21
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

References
1. P. C. Gilmore and R. E. Gomory (1961) Operations Research 9(6). Retrieved
from https://doi.org/10.1287/opre.9.6.849
2. M. Iori, V. L. De Lima, S. Martello, F. K. Miyazawa, and M. Monaci (2021)
European Journal of Operational Research 289(2). Retrieved from https:
//doi.org/10.1016/j.ejor.2020.06.047
3. R. W. Haessler and P. E. Sweeney (1991) European Journal of Operational
Research 54(2). Retrieved from https://doi.org/10.1016/0377-2217(91)
90216-U
4. A. R. Pitombeira-Neto and A. H. Murta (2022) EURO Journal on Computa-
tional Optimization 10. Retrieved from https://doi.org/10.1016/j.ejco.
2021.100027
5. Yizhun Wang (November, 2023) Theoretical and Natural Science 14. Re-
trieved from https://www.researchgate.net/publication/376076453_Review_
on_greedy_algorithm

Assignment for Mathematical Modeling - Academic year 2024 - 2025 Page 21/21

You might also like