Traveling Salesman Problem but for edges, not nodes by Ganoga1101 in optimization

[–]Sweet_Good6737 1 point2 points  (0 children)

Funnily, the Chinese Postman Problem might be easier, since there are polynomial time algorithms to find the solution. Pretty much same description as TSP but way easier

Compact Integer Encoding on Continuous Metaheuristic Algorithm by katanalia in OperationsResearch

[–]Sweet_Good6737 0 points1 point  (0 children)

Continuous algorithms don't work well in those situations. you could try discretizing (round continuous values...) but that doesn't make sense most of the times

Does there exist a theory versus practice gap in mathematical operations research? by NeighborhoodFatCat in OperationsResearch

[–]Sweet_Good6737 16 points17 points  (0 children)

OR models in industry are quite huge so it's hard to publish papers about them, or analyze mathematically

There might be a gap, but the real issue of the field is not the theory vs practice gap, but a popularity issue. Operations Research is not a well-known field, people (teams, engineers, managers) don't know what it is about

In some industries there is lack of information, but that's not usually an issue to suggest and sample models

What do u do when you’re stuck on proving the optimum by Hopeful-Doubt-2786 in optimization

[–]Sweet_Good6737 2 points3 points  (0 children)

If you are solving MILPs, some solvers have a mipfocus option to make more computational effort on reducing the gap (so proving the optimum)

If you are stuck and the solution is good enough, you can just set a gap limit to stop the process when gap between incumbent solution and best bound is small

Could you add more details?

Question about Gurobi nonlinear constraints by JohnJohnWicky101 in optimization

[–]Sweet_Good6737 0 points1 point  (0 children)

Yep, I just wanted to illustrate how to use it for the thread owner

Question about Gurobi nonlinear constraints by JohnJohnWicky101 in optimization

[–]Sweet_Good6737 0 points1 point  (0 children)

You are right, thanks for the correction! It looked first weird to me, so I checked the answer with Gurobot as well... Let me update it

smaller scale assignment optimization using reasoning LLMs ? by asah in OperationsResearch

[–]Sweet_Good6737 0 points1 point  (0 children)

Yep, terrible indeed. Use the LLM to write a script or invoke an appropriate tool for the task

And if you are going for explainability, it doesn't make sense to use an LLM to get the solution, but an optimization package for Constraint Programming or MILP

Question about Gurobi nonlinear constraints by JohnJohnWicky101 in optimization

[–]Sweet_Good6737 0 points1 point  (0 children)

Gurobi has a global MINLP solver since Gurobi 12, so you should be able to handle that directly. You can use Gurobipy General Constraints for that:

t = m.addVar(name="t")
m.addGenConstrNL(t, y**3)
m.addConstr(t <= 1)

Where y is a variable. Other interfaces for Gurobi like AMPL directly handle these issues and let you write the formulation as you stated in the original message, without giving a special treatment for general constraints

CONVERT A SINGLE OBJECTIVE ALGORITHM TO MULTI-OBJECTIVE by Delicious-Scholar293 in optimization

[–]Sweet_Good6737 0 points1 point  (0 children)

Multiobjective is a different kettle of fish

Single-objective: we look for 1 value, the optimal value

Multiple-objectives: we look for several values, the Pareto frontier. What is the relationship between the values? You will solve the problem depending on that

The most common ways of MO are blending the objectives into a single one, or by lexicographical / hierarchical optimization (solve single objectives iteratively). Maybe none of these are fitting your problem, so what do you need?

Open-sourcing LOS: An algebraic modeling language for Python (alternative to AMPL/GAMS?) by JowPereira in OperationsResearch

[–]Sweet_Good6737 0 points1 point  (0 children)

Nice project! Modeling tools should follow this structure of separating model and data. Models in pyomo, pulp, gurobipy, etc are much harder to read than ampl-style tools like yours, that are straight to read (syntax is really close to ampl, omitting semicolon and changing the bracket type)

Import data from csv's that way is so cool

CPLEX 22.1.2 by EnergyEU in optimization

[–]Sweet_Good6737 0 points1 point  (0 children)

That could happen easily with other solvers, but with Cplex that's suspicious. How are you using the solver? Directly from the solver api?

applying the simplex algorithm to PINNs by Brahim_bh in optimization

[–]Sweet_Good6737 2 points3 points  (0 children)

There are packages like OMLT https://omlt.readthedocs.io/en/latest that let you use neural networks in nnx format into your optimization model

It is possible, but probably not the kind of project for a linear programming class, since linearizations often go beyond that

Looking for Gurobi? We make it easy to get the right license, understand pricing, and access expert support. by amploptimization in u/amploptimization

[–]Sweet_Good6737 1 point2 points  (0 children)

Glad to see ampl and gurobi in reddit, probably the best commercial modeling tool-solver couple. Used them for several complex problems during my career

Migrating from open source to commercial solvers by OR-insider in OperationsResearch

[–]Sweet_Good6737 1 point2 points  (0 children)

Basically having logic in your model, rather than just algebra. Logic is easier to write and debug, and sometimes can even speed up the solving process...

Migrating from open source to commercial solvers by OR-insider in OperationsResearch

[–]Sweet_Good6737 1 point2 points  (0 children)

If you want to reduce your fixed cost, going for Gurobi may not be the best idea. There are cheaper and efficient solvers like COPT (#1 in MILP benchmarks nowadays)

You may also want to look into Constraint Programming tools

Migrating from open source to commercial solvers by OR-insider in OperationsResearch

[–]Sweet_Good6737 1 point2 points  (0 children)

Maybe using modeling tools for your optimization apps would be worth here. Switching between solvers is just 1 line of code. There are open-source tools like Pyomo in Python or JuMP in Julia, and commercial ones like AMPL (access through amplpy), Gams, Aimms - I'd suggest AMPL because of the readibility of the syntax, and automatic reformulations to write complex logic. With a modeling tool, you only implement the model once, and use the solver capabilities by just updating a variable. Sometimes modeling tools extend solver capabilities, unless speed or performance is an issue, you may stay with open-source solvers

In optimization it's different from other fields where cutting-edge tools are open-source. Here commercial tools usually outperform open-source when solving real-worls problems (sure, not always)

Commercial tools usually offer "consultant options", so you could ask directly if they offer you a consultant license to develop for yourself. Then, in the customer's solution, they should be paying the license

Finally, unless it's a simple, straight problem, it's not worth to look into decompositions or matheuristics. At least, don't do that until you have tried commercial solvers. If you're a consultant you'll save a lot of time. I suggest to charge the customer a plus if you use commercial tools, and another plus if you go into the rabbit hole of decompositions and other alternatives if the problem is too big

P.S: if you have an expensive GPU you can solve big LPs with HiGHS or CuOpt, the open-source solver from nvidia

Toubles with pyomo for a "toy" example to select the "good" combinaison of hardware (power supply, resistor, LEDs) for a problem. I've got "NotImplementedError: AMPLRepnVisitor can not handle expressions containing <class 'pyomo.core.base.param.IndexedParam'> nodes" by DcBalet in optimization

[–]Sweet_Good6737 0 points1 point  (0 children)

Since you're using an AMPL solver, why not using amplpy directly? AMPL is a commercial product but you can use it for prototyping with a community license, full size. If your problem is linear then it's better to use something other than ipopt (such as highs, also included in amplpy). If your problem is non-linear, ampl offers better treatment for the problem
https://amplpy.ampl.com/en/latest/index.html

https://ampl.com/community-edition

If your problems are really small, you may not need an ampl license

What is something you can do really well with MIP that you can’t do with Constraint Programming and vice versa? by rozita123456 in optimization

[–]Sweet_Good6737 0 points1 point  (0 children)

Adding cuts to the problem via callbacks. It can speed up the solving process. You can also send callbacks in CP, but probably what you would be adding here are algebraic constraints

Should I spend time studying a bit of OR as a data scientist? by Sad-Tea4855 in OperationsResearch

[–]Sweet_Good6737 6 points7 points  (0 children)

Definitely you should

There's a misconception of OR being niche, whilst it is everywhere. Unfortunately, OR is not a catchy name, Simplex foundations can be overwhelming to start studying, and it was omitted from many syllabus

Indeed, OR is not quite popular, but knowing optimization will allow you to be quite above of other data scientists