Skip to content

Commit

Permalink
Fix various minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrozocca committed Jun 4, 2024
1 parent b3d1185 commit 7b76436
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 285 deletions.
8 changes: 5 additions & 3 deletions intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Hands-On Mathematical Optimization with Python

Welcome to this repository of companion notebooks for the book *Hands-On Mathematical Optimization with Python*, which will be published by Cambridge University press in 2024. This book introduces the concepts and tools of mathematical optimization with examples from a range of disciplines. The goals of these companion notebooks are to:
Welcome to this repository of companion notebooks for the book *[Hands-On Mathematical Optimization with Python](https://www.cambridge.org/highereducation/books/hands-on-mathematical-optimization-with-python/F15ABA8AF886E7E6F7444151F40683A1#overview)*, which will be published by Cambridge University press in October 2024.

This book introduces the concepts and tools of mathematical optimization with examples from a range of disciplines. The goals of these companion notebooks are to:

* Provide a foundation for hands-on learning of mathematical optimization,
* Demonstrate the tools and concepts of optimization with practical examples,
Expand Down Expand Up @@ -36,7 +38,8 @@ If you wish to cite this work, please use
author = {Postek, Krzysztof and Zocca, Alessandro and Gromicho, Joaquim and Kantor, Jeffrey},
title = {{Hands-On Mathematical Optimization with Python}},
year = {2024},
publisher = {Cambridge University Press}
publisher = {Cambridge University Press},
place={Cambridge}
}
```

Expand All @@ -49,6 +52,5 @@ and
year = {2024},
publisher = {GitHub},
howpublished = {\url{https://github.com/mobook/MO-book}},
note = {Textbook to be published by Cambridge University Press},
}
```
2 changes: 1 addition & 1 deletion notebooks/01/03-production-planning-advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
"\\end{aligned}\n",
"$$\n",
"\n",
"where the upper bounds, $b_r$ and $b_q$, come from the tables of attributes. For cases where the upper bounds don't apply, we can either insert bounds larger than would ever be encountered, or, when we translate this model to Pyomo, designate a special value that causes the bound to be ignored.\n",
"where the upper bounds, $b_r$ and $b_p$, come from the tables of attributes. For cases where the upper bounds don't apply, we can either insert bounds larger than would ever be encountered, or, when we translate this model to Pyomo, designate a special value that causes the bound to be ignored.\n",
"\n",
"The objective is given as before,\n",
"\n",
Expand Down
21 changes: 11 additions & 10 deletions notebooks/02/01-bim.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,28 @@
"\n",
"In maximizing this quantity, we have to respect some constraints. We know that we cannot use more raw materials than those are available in stock. \n",
"\n",
"For silicon, this means that the joint usage for logic chips, which is equal to $4x$ g (4g per chip for each of the $x$ chips), and for memory chips, which is equal to $y$ g (1g per chip for each of the $y$ chips), cannot exceed the maximum availability of 1000g of silicon:\n",
"For copper, this means that the joint usage for logic chips, which is equal to $4x$ g (4g per chip for each of the $x$ chips), and for memory chips, which is equal to $2y$ g (2g per chip for each of the $y$ chips), cannot exceed the maximum availability of 4800g of copper:\n",
"\n",
"$$\n",
" 4x + y \\leq 1000.\n",
" 4x + 2y \\leq 4800.\n",
"$$\n",
"\n",
"Similarly, we can deduce the condition for germanium where only the memory chip plays a role (logic chips don not require this element),\n",
"Similarly, we can deduce the condition for silicon, which involves only logic chips (note that memory chips do not require this element),\n",
"\n",
"$$\n",
" y \\leq 1500,\n",
" x \\leq 1000,\n",
"$$\n",
"\n",
"for plastic,\n",
"the condition for germanium, which involves only memory chips (note that logic chips do not require this element),\n",
"\n",
"$$\n",
" x + y \\leq 1750,\n",
" y \\leq 1500,\n",
"$$\n",
"\n",
"and for copper,\n",
"and the condition for plastic, which involves both types of chips,\n",
"\n",
"$$\n",
" 4x + 2y \\leq 4800.\n",
" x + y \\leq 1750.\n",
"$$"
]
},
Expand Down Expand Up @@ -156,7 +157,7 @@
"\n",
"This problem is relatively small, featuring only $n=2$ decision variables and $m=4$ constraints. However, it is easy to imagine that adding more products and constraints would significantly complicate matters. In such cases, explicitly listing each constraint and fully expanding all expressions could obfuscate the overall structure, making it challenging to discern the key aspects of the problem. In fact, it is much more common to formulate, analyze, and compare linear optimization problems using vectors and matrices. This format not only aligns more closely with computational implementation, but also greatly facilitates the identification of the similarities between various LO problems, regardless of whether they are about chip production or food manufacturing.\n",
"\n",
"If you are new or need to refresh on how equations and inequalities can be formulated using vectors and matrices, we refer you to the [book](../../intro.md). \n",
"If you are new or need to refresh on how equations and inequalities can be formulated using vectors and matrices, we refer you to the [printed version of this book](https://www.cambridge.org/highereducation/books/hands-on-mathematical-optimization-with-python/F15ABA8AF886E7E6F7444151F40683A1#overview), which includes more technical details and more extensive background information on this topic.\n",
"\n",
"As a first step towards building a vector-matrix formulation of our problem, we rename the decision variables $x$ and $y$ as $x_1$ and $x_2$, obtaining\n",
"\n",
Expand Down Expand Up @@ -357,7 +358,7 @@
"\n",
"To answer such questions in one go for an entire class of optimization problem, it is customary to define a so-called \\textit{canonical form} of the optimization problem, which specifies (i) whether the objective is a maximization or minimization, (ii) if the constraints are inequalities or equalities, and (iii) what signs do the variables take. Once we commit to a specific canonical form, we can derive all sorts of useful results and properties, which will hold for all problems in the considered class anyway (because any problem can be transformed to a given form), without the need of considering cases like 'if the problem is a maximization then ..., and if it is a minimization then...'. \n",
"\n",
"In this book, we adhere to the standard convention of representing LO problems with an objective of minimization, all constraints being of the $\\geq$ type, and all variables being nonnegative. In other words, we work with the following general formulation:\n",
"We adhere to the standard convention of representing LO problems with an objective of minimization, all constraints being of the $\\geq$ type, and all variables being nonnegative. In other words, we work with the following general formulation:\n",
"\n",
"A general **linear optimization (LO)** is a problem of the form\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/02/05-bim-fractional.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
" & y_2 \\leq 1500 \\cdot t \\quad &\\text{(germanium)} \\\\\n",
" & y_1 + y_2 \\leq 1750 \\cdot t \\quad &\\text{(plastic)} \\\\\n",
" & 4y_1 + 2y_2 \\leq 4800 \\cdot t \\quad &\\text{(copper)} \\\\\n",
" & \\frac{7}{6}y_1 + \\frac{5}{6}y_2 + 100y = 1 \\quad &\\text{(fraction)} \\\\\n",
" & \\frac{7}{6}y_1 + \\frac{5}{6}y_2 + 100 t = 1 \\quad &\\text{(fraction)} \\\\\n",
" & y_1, y_2, t \\geq 0.\n",
"\\end{align*}\n",
"$$\n",
Expand Down
29 changes: 16 additions & 13 deletions notebooks/02/08-L1-regression-wine-quality.ipynb

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions notebooks/04/04-exam-room-scheduling.ipynb

Large diffs are not rendered by default.

276 changes: 34 additions & 242 deletions notebooks/05/01-milk-pooling.ipynb

Large diffs are not rendered by default.

0 comments on commit 7b76436

Please sign in to comment.