#pyomo — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #pyomo, aggregated by home.social.
-
Locational marginal pricing of potatoes
We apply Locational Marginal Pricing (LMP) to the supply of potatoes. The article describes the model, calculation of LMPs, and scenarios for how the suppliers and contractors may respond to the price signals.
#orms #pyomo
https://www.solvermax.com/blog/locational-marginal-pricing-of-potatoes -
Permission granted: A role mining model
We implement a recently published role mining model using both constraint programming and mixed integer linear programming, then compare their relative performance while solving several examples.
https://www.solvermax.com/blog/permission-granted-a-role-mining-model
#orms #pyomo #ortools #python -
Как нам удалось в 100 раз ускорить решение оптимизационной задачи NBO в Альфа-Банке
В данной статье мы расскажем, как нам удалось найти решение задачи NBO на open source солвере CBC примерно в 100 раз и добиться повышения оптимального значения целевой функции на 0.5%.
https://habr.com/ru/companies/glowbyte/articles/838410/
#Математическая_оптимизация #исследование_операций #ускорение_солверов #cbc #pyomo #nbo #маркетинговая_оптимизация #линейное_программирование #машинное+обучение
-
Как нам удалось в 100 раз ускорить решение оптимизационной задачи NBO в Альфа-Банке
В данной статье мы расскажем, как нам удалось найти решение задачи NBO на open source солвере CBC примерно в 100 раз и добиться повышения оптимального значения целевой функции на 0.5%.
https://habr.com/ru/companies/glowbyte/articles/838410/
#Математическая_оптимизация #исследование_операций #ускорение_солверов #cbc #pyomo #nbo #маркетинговая_оптимизация #линейное_программирование #машинное+обучение
-
Как нам удалось в 100 раз ускорить решение оптимизационной задачи NBO в Альфа-Банке
В данной статье мы расскажем, как нам удалось найти решение задачи NBO на open source солвере CBC примерно в 100 раз и добиться повышения оптимального значения целевой функции на 0.5%.
https://habr.com/ru/companies/glowbyte/articles/838410/
#Математическая_оптимизация #исследование_операций #ускорение_солверов #cbc #pyomo #nbo #маркетинговая_оптимизация #линейное_программирование #машинное+обучение
-
Article: Well, that escalated quickly: Random search
In this series of articles, we look at a simple optimization situation that requires deciding the best order for positioning devices in a rack.
This article discusses Model 2, which uses a random search method running in parallel. Does it perform better than the enumeration method of Model 1?
Along the way, we asked Claude AI to help with some of the programming. Claude was useful, though the experience was somewhat mixed.
https://www.solvermax.com/blog/well-that-escalated-quickly-random-search
#Python #pyomo #orms #optimization #modelling #ClaudeAI -
Reinforcement Learning в задаче групповой оптимизации цен
Привет, Хабр! Ранее мы рассмотрели вопрос применения подходов Reinforcement Learning в ценообразовании в разрезе одного товара. В этой статье покажем, как можно применить RL при наличии ограничений на группу товаров при помощи оптимизации с ограничениями.
https://habr.com/ru/companies/X5Tech/articles/826400/
#математика #машинное_обучение #reinforcement_learning #pyomo #многорукий_бандит
-
Article: Well, that escalated quickly: Enumeration
In this series of articles, we look at a simple situation that requires deciding the best order for positioning devices in a rack. We use four methods for solving this problem:
- Model 1. Enumerate all possible position orders.
- Model 2. Search randomly for a specified time.
- Model 3. Constraint programming using OR-Tools.
- Model 4. Mixed integer linear programming using Pyomo.Along the way, we see how a problem's size can quickly escalate to a colossal magnitude. We also demonstrate how, contrary to popular belief, that magnitude is not necessarily a barrier to finding a good solution.
We start with Model 1. The other models will follow.
https://www.solvermax.com/blog/well-that-escalated-quickly-enumeration
#Python #pyomo #orms #optimization #modelling -
Article: Formulations for modelling an IF function
When formulating an optimization model, a common question is "How do I express an IF function as a constraint?". Linear programs can't represent an IF function directly, so we need to use some linearization tricks to achieve the behaviour we want.
In this article, we examine the answers to a question on Operations Research Stack Exchange: Linear condition between two continuous variables.
Three answers are provided on Stack Exchange:
- Formulation 1. A special case method that has the advantage of being a pure linear program, though it works correctly only when the model has a specific form of objective function.
- Formulation 2. Uses a BigM approach that would normally work, but the answer has a subtle error.
- Formulation 3. Essentially the same as Formulation 2, except that it is correct.We illustrate each of the methods both mathematically and graphically, to show how they are intended to mimic the required IF statements.
In addition, we derive a formulation from the more general situation for the constraint x = max(y, z).
https://www.solvermax.com/blog/formulations-for-modelling-an-if-function
#Python #pyomo #orms #optimization #modelling -
Article: 10 times faster, running cases in parallel
In this article, we explore running optimization model cases in parallel. Specifically, we use the Python multiprocessing and mpi4py libraries to fully use the many CPU cores/threads in modern computers.
Our goals are to:
- Illustrate how to apply the multiprocessing and mpi4py libraries to running optimization model cases in parallel.
- Measure the performance of running cases in parallel compared with serially.
- Compare the performance of an old 4 core / 4 thread CPU with a new 20 core / 28 thread CPU, using the HiGHS solver.https://www.solvermax.com/blog/10-times-faster-running-cases-in-parallel
#Python #pyomo #orms #optimization #modelling #HiGHS #multiprocessing #mpi4py -
Warehouse space for free: Exogenous enumeration
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 3 of 3, we make some variables exogenous and enumerate all of their combinations. The goal is to make the model solvable at full scale in a reasonable time.
The result is a 200 times improvement in model performance, leading to a 40% improvement in warehouse storage efficiency.
The model is built in Python using Pyomo, and solved with either the Gurobi or HiGHS solvers.
https://www.solvermax.com/blog/warehouse-space-for-free-exogenous-enumeration
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Exogenous enumeration
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 3 of 3, we make some variables exogenous and enumerate all of their combinations. The goal is to make the model solvable at full scale in a reasonable time.
The result is a 200 times improvement in model performance, leading to a 40% improvement in warehouse storage efficiency.
The model is built in Python using Pyomo, and solved with either the Gurobi or HiGHS solvers.
https://www.solvermax.com/blog/warehouse-space-for-free-exogenous-enumeration
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Exogenous enumeration
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 3 of 3, we make some variables exogenous and enumerate all of their combinations. The goal is to make the model solvable at full scale in a reasonable time.
The result is a 200 times improvement in model performance, leading to a 40% improvement in warehouse storage efficiency.
The model is built in Python using Pyomo, and solved with either the Gurobi or HiGHS solvers.
https://www.solvermax.com/blog/warehouse-space-for-free-exogenous-enumeration
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Exogenous enumeration
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 3 of 3, we make some variables exogenous and enumerate all of their combinations. The goal is to make the model solvable at full scale in a reasonable time.
The result is a 200 times improvement in model performance, leading to a 40% improvement in warehouse storage efficiency.
The model is built in Python using Pyomo, and solved with either the Gurobi or HiGHS solvers.
https://www.solvermax.com/blog/warehouse-space-for-free-exogenous-enumeration
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Exogenous enumeration
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 3 of 3, we make some variables exogenous and enumerate all of their combinations. The goal is to make the model solvable at full scale in a reasonable time.
The result is a 200 times improvement in model performance, leading to a 40% improvement in warehouse storage efficiency.
The model is built in Python using Pyomo, and solved with either the Gurobi or HiGHS solvers.
https://www.solvermax.com/blog/warehouse-space-for-free-exogenous-enumeration
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Linearized model
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 2 we linearize our model to, hopefully, make it easier to solve.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-linearized-model
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Linearized model
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 2 we linearize our model to, hopefully, make it easier to solve.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-linearized-model
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Linearized model
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 2 we linearize our model to, hopefully, make it easier to solve.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-linearized-model
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Linearized model
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 2 we linearize our model to, hopefully, make it easier to solve.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-linearized-model
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
Warehouse space for free: Linearized model
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
In part 2 we linearize our model to, hopefully, make it easier to solve.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-linearized-model
#Python #pyomo #orms #optimization #modelling #Gurobi #HiGHS -
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
Along the way, we:
- Formulate a non-linear model of the situation.
- Compare several solvers, to see how they perform.
- Linearize our model to, hopefully, make it easier to solve.
- Disaggregate our model to make some variables exogenous, then iterate over an enumeration of the exogenous variables.
- Demonstrate use of Pyomo's last() and next() functions, which enable us to work with elements of ordered sets.
- Turn off a constraint using Pyomo's deactivate() function.Importantly, we show that there's a surprising amount of extra storage space available for free, or minimal cost, just by redesigning the warehouse's racks and shelves.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-non-linear-model
-
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
Along the way, we:
- Formulate a non-linear model of the situation.
- Compare several solvers, to see how they perform.
- Linearize our model to, hopefully, make it easier to solve.
- Disaggregate our model to make some variables exogenous, then iterate over an enumeration of the exogenous variables.
- Demonstrate use of Pyomo's last() and next() functions, which enable us to work with elements of ordered sets.
- Turn off a constraint using Pyomo's deactivate() function.Importantly, we show that there's a surprising amount of extra storage space available for free, or minimal cost, just by redesigning the warehouse's racks and shelves.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-non-linear-model
-
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
Along the way, we:
- Formulate a non-linear model of the situation.
- Compare several solvers, to see how they perform.
- Linearize our model to, hopefully, make it easier to solve.
- Disaggregate our model to make some variables exogenous, then iterate over an enumeration of the exogenous variables.
- Demonstrate use of Pyomo's last() and next() functions, which enable us to work with elements of ordered sets.
- Turn off a constraint using Pyomo's deactivate() function.Importantly, we show that there's a surprising amount of extra storage space available for free, or minimal cost, just by redesigning the warehouse's racks and shelves.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-non-linear-model
-
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
Along the way, we:
- Formulate a non-linear model of the situation.
- Compare several solvers, to see how they perform.
- Linearize our model to, hopefully, make it easier to solve.
- Disaggregate our model to make some variables exogenous, then iterate over an enumeration of the exogenous variables.
- Demonstrate use of Pyomo's last() and next() functions, which enable us to work with elements of ordered sets.
- Turn off a constraint using Pyomo's deactivate() function.Importantly, we show that there's a surprising amount of extra storage space available for free, or minimal cost, just by redesigning the warehouse's racks and shelves.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-non-linear-model
-
In this article series, we look at improving the efficiency of a pallet warehouse, where all items are stored on standard-size pallets.
Along the way, we:
- Formulate a non-linear model of the situation.
- Compare several solvers, to see how they perform.
- Linearize our model to, hopefully, make it easier to solve.
- Disaggregate our model to make some variables exogenous, then iterate over an enumeration of the exogenous variables.
- Demonstrate use of Pyomo's last() and next() functions, which enable us to work with elements of ordered sets.
- Turn off a constraint using Pyomo's deactivate() function.Importantly, we show that there's a surprising amount of extra storage space available for free, or minimal cost, just by redesigning the warehouse's racks and shelves.
The model is built in Python using Pyomo.
https://www.solvermax.com/blog/warehouse-space-for-free-non-linear-model
-
Blog: Running up the wrong hill
We explore some aspects of solver behaviour when solving non-linear optimization models.
Our goal is to provide insights into what the solvers are doing, why they may find different solutions, and how we can improve our chances of finding at least a good, and hopefully a globally optimal, solution.
The model is built in Python using Pyomo.
-
Blog: Optimal but not practical - Virtual machine
We address a common modelling issue: The solution is optimal, but not practical.
In the final article of this series, we describe the process of setting up and using a virtual machine in "the cloud".
Specifically, we create a Compute Engine, which is part of the Google Cloud suite of services.
We describe how we solved the issues we encountered along the way.
In the end, we're able to use the Compute Engine solve a model using a data set that is much too large for our local machine.
#Python #Pyomo #optimization #orms #HiGHS #cloudcomputing
https://www.solvermax.com/blog/optimal-but-not-practical-virtual-machine -
Blog: Optimal but not practical - Either/or Disjunction (Model 5c)
We address a common modelling issue: The solution is optimal, but not practical.
In Model 5c we use Pyomo's Generalized Disjunctive Programming (GDP) extension to express either/or constraints.
We describe how the GDP extension can be used to represent either/or constraints in a simple linear program. Along the way, we compare BigM constraints that we create manually with BigM constraints created automatically by the GDP extension. Then we use the GDP extension to build either/or constraints in our paper coverage situation.
#Python #Pyomo #optimization #orms #HiGHS
https://www.solvermax.com/blog/optimal-but-not-practical-either-or-disjunction -
Blog: Optimal but not practical - Either/or BigM (Model 5)
We address a common modelling issue: The solution is optimal, but not practical.
In Model 5 we use a BigM constraint technique to represent either/or constraints.
With this technique we explicitly represent rotating the items, so that they can be in portrait or landscape orientation (but not both). The BigM constraint technique can be used for representing a variety of logical conditions in linear programming models.
#Python #Pyomo #optimization #orms #HiGHS
https://www.solvermax.com/blog/optimal-but-not-practical-either-or-bigm -
Blog: Optimal but not practical - Column generation (Model 4)
We address a common modelling issue: The solution is optimal, but not practical.
In Model 4 we extend our modelling to use a random column generation technique.
This technique enables us to solve a model that would be far too large for our computer to handle. For example, with a run time of just a few minutes, we can solve a model that would otherwise have 1 billion variables and require terabytes of RAM.
#Python #Pyomo #optimization #orms #HiGHS
https://www.solvermax.com/blog/optimal-but-not-practical-random-column-generation -
Blog: Optimal but not practical - Linear, Full data set (Model 3)
We address a common modelling issue: The solution is optimal, but not practical.
We extend Model 2 so that Model 3 uses the full data set. Consequently, Model 3 has over 1 million binary variables.
We use the HiGHS open-source solver, in an attempt to find globally optimal solutions for each of the cases.
Model 3 is quite big. Will it work?
#Python #Pyomo #optimization #orms #HiGHS
https://www.solvermax.com/blog/optimal-but-not-practical-full-data-set -
Blog: Optimal but not practical - Linear, partial data set (Model 2)
We address a common modelling issue: The solution is optimal, but not practical.
In this series of articles, we use a variety of techniques to create several models. Along the way, we address the trade-off between our quantitative and qualitative objectives, enabling the decision maker to make an informed decision to implement an efficient and practical solution.
Our first attempt was a non-linear model that provided valuable insights but not a usable solution. In this article we linearize our model and use a partial data set to keep the model size small. The hope is that it will produce better solutions.
#Python #Pyomo #optimization #orms
https://www.solvermax.com/blog/optimal-but-not-practical-linear-partial-data-set -
Blog: Optimal but not practical - First attempt
We address a common modelling issue: The solution is optimal, but not practical.
In our situation, the stated objective is to minimize trim waste in our paper manufacturing process. There is a theoretically perfect solution, with zero waste, but it is impractical to implement due to its complexity.
In this series of articles, we use a variety of techniques to create several models. Along the way, we address the trade-off between our quantitative and qualitative objectives, enabling the decision maker to make an informed decision to implement an efficient and practical solution.
#Python #Pyomo #optimization #orms
https://www.solvermax.com/blog/optimal-but-not-practical-first-attempt -
Blog: Julia/JuMP vs Python/Pyomo
In this article we develop an optimization model in the Julia programming language, using the JuMP mathematical optimization package.
Our objectives are to:
- Write a linear programming model using Julia/JuMP.
- Compare the model with an equivalent model written using Python/Pyomo.https://www.solvermax.com/blog/julia-jump-vs-python-pyomo
#Python #Pyomo #JuliaLang #JuMP #orms -
Blog article: Refactor Python models into modules
In this article we explore two aspects of working with multiple variations of an optimization model:
- Modularization. We refactor an existing model into modules, consisting of functions located in separate files.
- Adding models. We extend the existing model by adding variations that make efficient use of the modular structure.Along the way, we look at shallow vs deep copying in Python. This is a topic that often causes subtle bugs, so it is important to understand when working with variations of a model.
https://www.solvermax.com/blog/refactor-python-models-into-modules
#Python #Pyomo #refactoring #orms -
Blog article: Schedule staff with enumerated shifts, Pyomo
We implement a staff scheduling model in Python and solve it using the CBC solver via Pyomo. The central feature of the model is enumerating all possible shifts and then deciding how many staff to allocate to each shift so that we meet the various constraints at least cost.
This article replicates the previous Excel/OpenSolver model in Python/Pyomo, enabling us to compare the two tools.
https://www.solvermax.com/blog/schedule-staff-with-enumerated-shifts-pyomo
-
Blog article: Schedule staff with enumerated shifts, Pyomo
We implement a staff scheduling model in Python and solve it using the CBC solver via Pyomo. The central feature of the model is enumerating all possible shifts and then deciding how many staff to allocate to each shift so that we meet the various constraints at least cost.
This article replicates the previous Excel/OpenSolver model in Python/Pyomo, enabling us to compare the two tools.
https://www.solvermax.com/blog/schedule-staff-with-enumerated-shifts-pyomo
-
Blog article: Schedule staff with enumerated shifts, Pyomo
We implement a staff scheduling model in Python and solve it using the CBC solver via Pyomo. The central feature of the model is enumerating all possible shifts and then deciding how many staff to allocate to each shift so that we meet the various constraints at least cost.
This article replicates the previous Excel/OpenSolver model in Python/Pyomo, enabling us to compare the two tools.
https://www.solvermax.com/blog/schedule-staff-with-enumerated-shifts-pyomo
-
Blog article: Schedule staff with enumerated shifts, Pyomo
We implement a staff scheduling model in Python and solve it using the CBC solver via Pyomo. The central feature of the model is enumerating all possible shifts and then deciding how many staff to allocate to each shift so that we meet the various constraints at least cost.
This article replicates the previous Excel/OpenSolver model in Python/Pyomo, enabling us to compare the two tools.
https://www.solvermax.com/blog/schedule-staff-with-enumerated-shifts-pyomo
-
We've added "Data-driven mathematical optimization in Python" to our list of free, online resources.
It is an online repository of companion notebooks designed to help people learn about mathematical optimization and model building. It isn't exactly a textbook, but it is a great resource. There are lots of examples, built using the Pyomo library.
If you know of any other free optimization resources, then please let us know.
https://www.solvermax.com/resources/links/textbooks-about-optimization/data-driven-mathematical-optimization-in-python
#orms #optimization #Python #Pyomo -
Blog article: Schedule staff with enumerated shifts, OpenSolver
We implement a staff scheduling model in Excel and solve it using the CBC solver via OpenSolver. The central feature of the model is enumerating all possible shifts and then deciding how many staff to allocate to each shift so that we meet the various constraints at least cost.
The next article will implement the same model in Python and solve it using the CBC solver via Pyomo, enabling us to compare the two tools.
https://www.solvermax.com/blog/schedule-staff-with-enumerated-shifts-opensolver
-
Blog article: Schedule staff with enumerated shifts, OpenSolver
We implement a staff scheduling model in Excel and solve it using the CBC solver via OpenSolver. The central feature of the model is enumerating all possible shifts and then deciding how many staff to allocate to each shift so that we meet the various constraints at least cost.
The next article will implement the same model in Python and solve it using the CBC solver via Pyomo, enabling us to compare the two tools.
https://www.solvermax.com/blog/schedule-staff-with-enumerated-shifts-opensolver
-
Blog article: Schedule staff with enumerated shifts, OpenSolver
We implement a staff scheduling model in Excel and solve it using the CBC solver via OpenSolver. The central feature of the model is enumerating all possible shifts and then deciding how many staff to allocate to each shift so that we meet the various constraints at least cost.
The next article will implement the same model in Python and solve it using the CBC solver via Pyomo, enabling us to compare the two tools.
https://www.solvermax.com/blog/schedule-staff-with-enumerated-shifts-opensolver
-
Blog article: Schedule staff with enumerated shifts, OpenSolver
We implement a staff scheduling model in Excel and solve it using the CBC solver via OpenSolver. The central feature of the model is enumerating all possible shifts and then deciding how many staff to allocate to each shift so that we meet the various constraints at least cost.
The next article will implement the same model in Python and solve it using the CBC solver via Pyomo, enabling us to compare the two tools.
https://www.solvermax.com/blog/schedule-staff-with-enumerated-shifts-opensolver
-
Production mix - Conclusions
We built a linear program in six Python libraries: #Pyomo, #PuLP, #ORTools, #Gekko, #CVXPY, and #SciPy.
This blog article summarizes our conclusions from using each of the libraries. We also indicate which library we prefer for various types of optimization modelling.
https://www.solvermax.com/blog/production-mix-conclusions
#orms #Python #DataScience #optimization -
Production mix - Model 11, SciPy
We build Model 11 of the Python "Production mix" series.
Our objective is to compare a model built using SciPy with the same model built using Pyomo.
#orms #Python #DataScience #optimization #Pyomo #SciPy
https://www.solvermax.com/blog/production-mix-model-11-scipy -
Production mix - Model 9, Gekko
We build Model 9 of the Python "Production mix" series.
Our objective is to compare a model built using Gekko with the same model built using Pyomo.
#orms #Python #DataScience #optimization #Pyomo #Gekko
https://www.solvermax.com/blog/production-mix-model-9-gekko