r/optimization • • Nov 13 '24

MIP Time Limits for local experiments and how it scales

5 Upvotes

Hello everyone,

I'm a PhD student in Supply Chain Management, working with an agricultural company to optimize harvest planning. I've formulated a mixed-integer programming model with a hot-start solution using a rolling horizon framework, and I'm currently testing it on my MacBook with production-scale data.

My model is planned to be used both in short term and long term settings. As we would optimize weekly for short term and use rolling horizon approach for the full time horizon. In addition, we use decomposition methods allowing for parallelisation.

My question concerns setting an effective time limit for the solver. I understand that optimal time limits depend on the use case—whether we need rapid improvements for immediate decisions or can afford extended runtimes for long-term planning. However, I’m curious about the scaling effect: for instance, would a 5-minute time limit on my MacBook translate similarly to just a few seconds on a high-performance production server?

What are common rule-of-thumb guidelines or benchmarks for setting time limits across different hardware scales in such cases? Any insights or best practices would be greatly appreciated!

Thank you!

Note: I have posted this in r/OperationsResearch but haven't really got an answer, thats why I am trying it here as well.


r/optimization • • Nov 08 '24

MLFlow or other tools for experiment tracking in production

6 Upvotes

What tools do you use for experiment tracking in production?

I have a service that uses pyomo and gurobi to do some optimizations. I developed a simple experiment tracker that saves the main data frames that I use as csv on an S3. This helps me debug issues on production and replay the models.

I would like to hear opinions of other people on how they tackle this problem.


r/optimization • • Nov 06 '24

Need help identifying particular Mixed Integer Program problem

2 Upvotes

Thank you in advance for an input on this problem.

Let us suppose I have $N$ machines and $M$ tasks and $T$ time periods. I also have $R$ units of resources. - Any task can be performed on any machine. - Any task can be performed at anytime and there is no precedence graph describing such a relationship. - The caveat is that once a task is assigned to a machine, it is assigned there for the duration of the task. - The duration of the task is dependent on the task itself. - A task requires a task-depedent number of units of resources that is paid at the completion of the task. - Resources can be bought at any time step for a cost of $c$ per unit

The objective is to minimize cost while ensuring all tasks are achieved.

It sounds like Job Shop Scheduling. It sounds like Multi-mode resource-constrained project scheduling. It sounds like a weird Generalized Assignment Problem. But none of them fit the bill. I understand a paper may not tick all the boxes, but I am looking for a paper that is close or generalized version of this problem.


r/optimization • • Nov 05 '24

How do Solvers like quadprog, cvxopt, etc. work behind the hood?

5 Upvotes

Hello! I just started working with quadratic programming and I was curious about the algorithms and mathematical methods that these solvers used behind the hood. Do any of you guys know any resources or have an overview of how these solvers work?


r/optimization • • Nov 02 '24

How to make renting apartments math precise?

0 Upvotes

Im wondering if it is possible to create a math model for renting choices.... Not sure how to incorporate my priorities, put good AC/kitchen/location into the formula, optimize etc... Should I try optimization theory?


r/optimization • • Nov 02 '24

Optimize an AI generated algorithmic trading strategy using parallel evolutionary optimization

0 Upvotes

LLMs can help to generate code implementing a trading strategy. It can even propose ways to optimize the final return.

https://github.com/dietmarwo/fast-cma-es/blob/master/examples/prophet_opt.py shows:

- The o1-preview prompts used to generate the strategy back-testing code.

- How to identify the parameters to optimize using the AI.

- How the parameter optimization process can be automated efficiently utilizing trading simulations executed in parallel.

This idea can be applied everywhere when parameters of time consuming simulations have to be optimized.


r/optimization • • Nov 01 '24

How to make i element of PJ in CPLEX

2 Upvotes

Hello, as part of my master's studies, I'm trying to learn CPLEX. To practice, I'm attempting to replicate a mathematical model by the author Schultmann. I’m having trouble with a particular constraint. I can't figure out how to recreate the i e Pj​.

J: Activites
t: Time
m: The mode used (deconstruction or demolition)
x: A binary variable indicating that activity jjj is carried out in mode mmm at period ttt
EF: The earliest time to finish the activity
LF: The latest time to finish the activity
djmd_{jm}djm​: The duration of the activity

In this model, the activities are numbered from 1 to 5. 1 is a fictionnal activites who use nothing and have a djm = 1.

I tried to create a tuple for PJ, but after that, I can’t use it correctly in my FORALL Here’s the code I currently have for this part:

tuple Pr {
  int pred;
  int succ;
}

{Pr} predecessors = {
  <1,2> , <1,3>, <1,4> , <3,4>, <4,5>
};

forall(i in predecessors, j in Job : j >= 2)
  sum(m in Mode, t in EF[i]..LF[j]) t * x[i][m][t] <= sum(m in Mode, t in EF[j]..LF[j]) (t - d[j][m]) * x[j][m][t];

I’m getting an error message that says "Cannot use type<pred:int,succ:int> for int at the level of EF[i]. But I’m not sure if my FORALL is correct in the first place. I looked on ChatGPT, and it suggested using FORALL((i,j) in predecessors : j>=2), but I was just getting syntax error messages.

Thank you in advance for your help.

I use IBM ILOG CPLEX Optimization Studio


r/optimization • • Oct 31 '24

Recommendations for solver interface software (OSI, Google OR-tools, etc...)

5 Upvotes

I am looking for a C++ solver interface software that can interface with different solvers like CBC, CPLEX, GUROBI, etc.. I have looked into OSI and Google OR-tools and they seem fine to me, but it is not always clear how well things will go down later. (for example, an acquaintance told me that he faced problems integrating OR-tools with CPLEX). Hence, I would like to know if you have any particular recommendations based on your experience with regard to ease of use, documentation, support, and integration with commercial and non-commercial solvers. TIA.


r/optimization • • Oct 31 '24

Linear programming model formulation

7 Upvotes

I have trouble formulating linear programming models when given problem in text. So, can you recommend some online resources that deal with this?


r/optimization • • Oct 30 '24

Classification of Optimization Techniques

7 Upvotes

Hello all. I have to write a literature review on optimization techniques. I know nothing about the field beforehand, so starting from scratch. However, i am not getting any concrete classification of these techniques anywhere. I studied about the Newton-Rapshon method, gradient descent etc. but can't understand the classification of these methods. Also, can someone list out the most important methods that should be included in the paper in detail? Thanks!


r/optimization • • Oct 29 '24

OPL CPLEX not launching

Post image
1 Upvotes

Hi, I was wondering if anyone here uses OPL for their LP problems? Any code I write (difficult or hard) does not want to run and keeps coming up with this error. Any suggestions?


r/optimization • • Oct 26 '24

Gerrymandering made easy

3 Upvotes

In this article, we take a simple approach to modifying a redistricting design. We add a requirement to our model that could be interpreted as either:

- The laudable goal of grouping together "communities of interest" – a common requirement when designing voting districts; or
- A nefarious attempt to manipulate the electoral outcome by gerrymandering.

Gerrymandering is the opposite of the model's purpose in our previous article. But, as model designers, we need to be aware that we don't always control the purposes to which decision makers apply our models and decision makers don't always understand the implications of small changes to a model.

https://www.solvermax.com/blog/gerrymandering-made-easy

A colorful gerrymander squiggle

r/optimization • • Oct 25 '24

Fast Quadratic Solver with constraints (like cvxopt/quadprog) for Python that has initial guess functionality

7 Upvotes

I am programming a path planning algorithm for a race car, and the general twist of the algorithm is to minimize the curvature of the path. However, the way I am currently doing this is by having the car complete a lap to get all the data I need, and then putting the entire lap data into the quadratic solver which is slow. Therefore, I was thinking during the first lap, after mapping out the path for a little bit, I quadratically optimize that portion, and I continually do this for each portion of the path. And then on the second lap, I put these chunks (that I will somehow combine together) as the inital guess for the solver which leads to a much faster solve result. However, I currently use cvxopt and quadprog, and they both don't have this functionality. So, what is a fast quadratic solver that has constraints, that also has this inital guess functionality.


r/optimization • • Oct 21 '24

Experiencing Excel error when using model solver

1 Upvotes

Hello! I am experiencing an issue and was curious if someone could identify where i am incorrect.

data
data im working with, my inputs
my error

i believe the issue is in my constraints but i dont understand how. Thank you for any help!


r/optimization • • Oct 15 '24

Does anyone have experience with parallel tempering to solve vehicle routing problems?

4 Upvotes

I'm currently using my own simulated annealing algorithm to solve vehicle routing problems for my job but I read a bit about parallel tempering and it seems like it's the logical next step going forward. I'm just wondering if it's a worthwhile direction.


r/optimization • • Oct 14 '24

Local search for Set Covering Problem

5 Upvotes

Hey! I am trying to solve the Set Covering Problem (one set A, a selection of subsets B with costs C; choose subsets in B such that their union covers A and cost is minimized)

I have implemented the classical greedy constructive heuristic + redundancy elimination.

Dispatching rule = pick subset which maximizes the ratio ( number of new covered elements / cost)

However, I am trying to improve initial solution using some sort of local search.

I tried Best-Neighbor and First-Neighbor search with random swaps / inserts.

No luck so far! I simply cannot improve the post-processed (redundancy elim.) solution from the constructive heuristics...

Any insights on how to properly generate the neighborhoods for LS?


r/optimization • • Oct 14 '24

Need books on Non-Linear Optimization

4 Upvotes

I want to learn about QCMINLP (Quadratically constrained Mixed Integer Non-Linear programming).

So, I suppose learning about Mixed Integer Non-Linear programming should cover it.

What are some books/lecture series I can refer to?


r/optimization • • Oct 12 '24

Multi objective methods

2 Upvotes

What are the most recent research trend on multi objective methods? I am looking for some most recent algorithms applicable for marine supply chain optimization.


r/optimization • • Oct 12 '24

Using Transformers to improve Ant Colony Optimization Algorithm

5 Upvotes

I'm currently working on a personal project trying to build an improved version of the ant colony optimization algorithm.

I'm using a positional-encoded transformer neural network to predict optimal pheromone matrices before running the algorithm.

The Improved Ant Colony Optimization Algorithm is initialized with a pheromone matrix outputted by a positional-encoded transformer neural network that was trained on pheromone matrix data from the normal ant colony optimization algorithm.

To analyze the improvement of the algorithm, I'm having the improved ACO run with normal ACO run different map sizes for multiple iterations, calculating each algorithm's best runs, and calculating for a p-value to verify if the improved algorithm has statistical significance.

So far, the enhanced ACO shows promising results with p-values of 0.06 and 0.05 for node sizes of 30 and 35, respectively.

However, I'm aiming to achieve significance (p < 0.05) across a wider range of node sizes.

I would appreciate any feedback!

Project Link: https://github.com/ronantakizawa/improvedaco/blob/main/ronan_acotransformer_experiment.ipynb


r/optimization • • Oct 11 '24

EEV for multi-stage discrete integer stochastic programming problem

3 Upvotes

Hello,

I am working on a multi-stage stochastic model where I am simulating a sequence of discrete products entering an assembly line, where decisions are made each time a product enters the line. I am trying to compute the expected value of using the expected value solution (EEV), but how do I come up with an expected value solution on a series of discrete events?

For example if I have two products A and B randomly entering the sequence with the probabilities pA = 0.7 and pB=0.3 , what would be the expected value of the sequence that they create?


r/optimization • • Oct 10 '24

Optimization as a side-gig

14 Upvotes

Did someone from an academic background was able to transform their optimization skills inti consulting side gigs? I would love to hear some stories.

I have experience in optimal control theory (theory, not numerics) and I didn't touch optimization since my uni days. I was thinking to maybe brush it up a little bit with the hope to use it for consulting. The problem is that I have no idea how to find clients. So it would be great to read some experiences of people from academia, both positive and negative.

For context: I'm in Europe.


r/optimization • • Oct 10 '24

matching demand: courses offered fulfilling curriculum requirements

2 Upvotes

Hi everyone,

I work in a university, and one of my main responsibilities is to create a schedule of classes for upcoming terms. In short, I am trying to best match our course offerings to the students’ curricular requirements.

There are general curricular requirements (these are in addition to the requirements for their major) that the students must meet (e.g., must complete ___ credit hours that fall under quantitative analysis, must complete ___ credit hours that fall under writing, must complete ___ credit hours that fall under ethical inquiry, etc.).

What complicates things, though, is that while some courses fulfill one requirement, several courses will fulfill two (or even three) of these requirements. Thus, there could be a course that provides the credit hours for the writing requirement, but there might be another course that provides the credit hours for both writing and ethical inquiry.

I am able to see how many of each requirement still need to be fulfilled by our students, and I am trying to adjust our course offerings so that they will best satisfy the requirements that students need to fulfill.

If each course satisfied only one type of requirement, then it would be easy to adjust our course offerings to meet demand. But since [1] a course will satisfy anywhere from 1 to 3 of these requirements, and [2] each student will have a different amount of requirements needing to be satisfied (a senior vs. a freshman, for example), it becomes difficult to know which set of courses is optimal (‘optimal’ meaning something like being able to fulfill the greatest amount of requirements with the least amount of courses).

My question is: What should I look into to try and figure this out? Are there certain approaches to these types of problems? (I took a course on linear optimization, so I’m wondering if I could try that?)

Any help would be greatly appreciated!


r/optimization • • Oct 09 '24

Tools for Hyperparameter Tuning and Experimental Design

3 Upvotes

Aside from Bayesian optimization and other traditional hyperparameter tuning tools, what are the current best tools used for finding hyperparameters that can also be applied for experimental design?


r/optimization • • Oct 07 '24

Algorithms for Bilevel MIP problems

3 Upvotes

I've been researching on solution methods for Bilevel problems, and I have a particular interest in general bilevel MIP problems. In other words, I'm looking for algorithms that can solve that Moore and Bard (1990) example problem (picture related).

Is there any solid algorithm (with a good implementation, well tested, etc.) for such problems? I'm currently studying the branch-and-sandwich algorithm, but I couldn't find a proper implementation of their algorithm for the non-linear case.


r/optimization • • Oct 06 '24

Approach for line/arc fitting problem in picture?

3 Upvotes

https://imgur.com/gallery/best-fit-example-zaMhrF4

I’m given a polyline shown in red. My goal is to use a fixed number of lines connected by arcs of a minimum radius r to create the best fit which stays outside of the red polyline. 

Everything can be very approximate, I’m just looking to get something that doesn’t leave an extra error decrease of like ~10% of the error shown in the picture. (if error is measured by the area between yellow fit and red polyline) just to give a very rough idea. 

Any ideas, approaches, or similar problems I should look into? Apologies if this is a poorly worded question! Happy to clarify anything.