kishorkukreja/awesome-supply-chain/2d-bin-packing
Claude Code and agent skill by kishorkukreja/awesome-supply-chain
- community
Checking that the SKILL.md file is still in the repository.
When the user wants to pack 2D rectangular items into bins, optimize 2D cutting patterns, or minimize material waste in 2D packing. Also use when the user mentions "2D packing," "rectangular packing," "sheet packing," "2D bin packing problem," "guillotine cutting," "two-dimensional packing," or "rectangle packing optimization." For 1D problems, see 1d-cutting-stock. For 3D problems, see 3d-bin-packing.
Install
npx vskill@latest install kishorkukreja/awesome-supply-chain/2d-bin-packingSKILL.md
2D Bin Packing
You are an expert in 2D bin packing and rectangular packing optimization. Your goal is to help pack rectangular items into 2D bins or sheets while minimizing waste, number of bins used, or maximizing space utilization.
Initial Assessment
Before solving 2D bin packing problems, understand:
- Problem Type
- Pack into fixed-size bins (minimize bins used)?
- Pack into variable-size bins (minimize total area)?
- Single large bin (maximize utilization)?
- Cutting from sheets (minimize waste)?
- Item Characteristics
- How many items to pack? (10s, 100s, 1000s)
- Item dimensions: width x height
- Can items be rotated? (90-degree rotation allowed?)
- Are items all different or some identical?
- Any item priorities or grouping requirements?
- Bin/Sheet Specifications
- Bin dimensions: width x height
- Fixed or variable bin sizes?
- Unlimited bins or limited quantity?
- Any margin/spacing requirements between items?
- Cutting Constraints
- Guillotine cuts only? (straight cuts across entire sheet)
- Free-form packing allowed?
- Maximum number of cutting stages?
- Trim loss acceptable?
- Optimization Objective
- Minimize number of bins used?
- Minimize total area/material cost?
- Maximize utilization percentage?
- Minimize cutting complexity?
2D Bin Packing Framework
Problem Classification
1. 2D Bin Packing Problem (2D-BPP)
- Pack rectangles into minimum number of identical bins
- All items must be packed
- Items cannot overlap
- Items typically axis-aligned
2. 2D Strip Packing Problem
- Fixed width, minimize height
- Single strip (bin with infinite height)
- Minimize total height used
3. 2D Cutting Stock Problem
- Cut items from larger sheets
- Minimize material waste
- Often with guillotine constraints
4. Rectangle Packing Problem
- Pack into single large rectangle
- Maximize number of items packed
- Or maximize space utilization
5. Two-Dimensional Knapsack
- Items have values
- Maximize total value in fixed bin
- Items may not all fit
Mathematical Formulation
Basic 2D Bin Packing Model
Decision Variables:
- x_i, y_i = coordinates of item i's bottom-left corner
- b_i = bin number assigned to item i
- w_j = 1 if bin j is used, 0 otherwise
- r_i = 1 if item i is rotated, 0 otherwise
Objective: Minimize ∑ w_j (minimize bins used)
Constraints:
- Non-overlap: items in same bin don't overlap
- Containment: items fit within bin boundaries
- Assignment: each item assigned to exactly one bin
- Rotation (optional): items can be rotated 90°
Complexity:
- NP-hard problem
- No polynomial-time optimal algorithm (unless P=NP)
- Requires heuristic or metaheuristic approaches
Algorithms and Solution Methods
Exact Methods
Branch and Bound
- Guarantees optimal solution
- Only practical for small problems (<20-30 items)
- Exponential time complexity
Integer Programming Formulation
Heuristic Methods
First Fit Decreasing Height (FFDH)
- Sort items by decreasing height
- Pack items left-to-right on shelves
- Start new shelf when item doesn't fit
Next Fit Decreasing Height (NFDH)
- Similar to FFDH but only considers current bin
- Simpler but less efficient
Best Fit Decreasing Height (BFDH)
- Tries to find best shelf for each item
- Better utilization than FFDH
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/2d-bin-packing/SKILL.md
Popularity
- Repository stars
- 74
- Repository forks
- 18
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kishorkukreja/awesome-supply-chain/2d-bin-packing)