Knapsack Problem
Select items to maximize value while staying within a weight limit. The classic optimization problem.
Complete worked examples, from basic selection to multi-constraint problems. Each one creates sample data, writes a query, and walks through the result.
Select items to maximize value while staying within a weight limit. The classic optimization problem.
Determine how many units of each product to manufacture within capacity constraints.
Select items matching specific criteria and ranges using BETWEEN and IN clauses.
Select meals to minimize cost while meeting nutritional requirements for protein, carbs, and fat.
Assign workers to tasks with multiple decision variables per row and equality constraints.
Use scalar subqueries and CASE expressions to compute constraint bounds dynamically.
Select assets to maximize expected return while respecting risk limits and diversification rules.
Assign resources to time slots across multiple tables using JOIN with decision variables.
Plan production across multiple time periods with inventory and complex expressions.
Check out the documentation for the complete syntax reference and learn more about the project.