I am curious about the algorithm in the PuLP
Is this LPsolver is using the simplex method?
PuLP provides a convenient frontend for a number of solvers. Some of these solvers may use simplex, others may not. You can specify the solver in order to better control this, but you'd need to look at the details for the individual solvers to figure out if any meet your criteria.
Related
So I want to try to solve my optimization problem using particle swarm optimiztion algorithm. As I comoratable with python I was looking into PySwarms toolkit. The issue is I am not really experienced in this field and don't really know how to account for integrality constraints of my problem. I was looking for advice on what are some approches to dealing with integral variables in PSO. And maybe some examples with PySwarms or any good alternative packages?
You can try pymoo module, which is an excellent multi-objective optimization tool. It can also solve mixed variable problems. Despite pymoo is first of all designed to solve such problems using genetic algorithms, there is an implementation of PSO (single-objective with continuous variables). Maybe you'll find it useful to try to solve your mixed variable problem using genetic algorithm or one of its modifications (e.g. NSGAII).
I'm currently working on an LP optimization problem with and looked into PuLP.
I know that PuLPs default solver is: PULP-CBC-CMD. I solved a test problem with this and I'm wondering what kind of algorithm this solver actually uses... it doesnt seem to be a simplex as my problem got interpreted completely differently than a simplex interpretion would look like?
Also: Every other solver for PuLP has to be added to PuLP manually right?
Also: what solvers are you guys working with in python?
Thanks in advance!
CBC is based on simplex, yes. But, like most solvers, it combines simplex with many other algorithms such as branch-and-bound and cut-generation.
In particular, to solve linear programs it uses Clp: https://github.com/coin-or/Clp
More information on the CBC solver in their site: https://github.com/coin-or/Cbc
I'm trying to solve an order minimization problem with python. Therefore I distribute M orders over N workers. Every worker has a basic energy-level X_i which is gathered in the vector X. Also, every order has a specific energy consumption E_j which is gathered in E. With that being said I'm trying to solve the following problem
where Y is some optimal energy level, with the norm beeing the 2-norm. Under the constraints, that any column adds up to exactly one, since an order should be done and could only be done by one worker. I looked at scipy.optimize but it doesn't seem to support this sort of optimization as far as I can tell.
Does one know any tools in Python for this sort of discrete optimization problem?
The answer depends on the norm. If you want the 2-norm, this is a MIQP (Mixed Integer Quadratic Programming) problem. It is convex, so there are quite a number of solvers around (e.g. Cplex, Gurobi, Xpress -- these are commercial solvers). It can also be handled by an MINLP solver such as BonMin (open source). Some modeling tools that can help are Pyomo and CVXPY.
If you want the 1-norm, this can be formulated as a linear MIP (Mixed Integer Programming) model. There are quite a few MIP solvers such as Cplex, Gurobi, Xpress (commercial) and CBC, GLPK (open source). Some modeling tools are Pyomo, CVXPY, and PuLP.
I am using Pyomo to model my optimization problem (MILP) and solve it using Gurobi.
What would be the best, fastest or easiest way to find a heuristic solution using the Pyomo model, knowing that I do not care about the Gap bounds.
Note: I know that Gurobi has a heuristic solver but it doesn't tell what heuristic algorithm they are using!
Finding a heuristic solution to some MILP problem is complexity-wise as hard as optimizing it!
There is no best, fastest, easiest way in general. You always want to exploit some problem-characteristics.
As start, just use any MIP-solver and tune the params to reflect your needs. If you want just any heuristic solution, tune the solver for feasibility, probably meaning a higher frequency of heuristic-steps and early-stop with the first feasible solution.
Yes, you won't know what's Gurobi using internally. But knowing all of the code would not help much either. It's surely not something which you can find on wikipedia then (except for classic stuff like the feasibility pump or Relaxation induced neighborhood search).
If you want to know more about these methods, check out papers on MIP-heuristics in general! You will see, that most Heuristics are tightly coupled with the MIP-nature of the problem (although i expect some SAT-solver-usage internally too in commercial ones).
I am using z3py to solve a set of equations. How would I calculate the runtime order of it?
It has bitvecs variables which need to be satisfied in a set of linear equations. The documentation and the guide does not give a way to calculate the runtime.
Are you asking for the (worst-case) time complexity of the used solvers? If so, I don't think that you'll be able to get a good answer: it depends on the (combination of) logic(s) into which your problem falls, e.g. QF_BV or UFNIA, and then on the ((semi) decision) procedures that the solver implements for that (combination of) logic(s).
Have a look at papers from the Z3 authors (https://github.com/Z3Prover/z3/wiki/Publications) - they might provide some details.