Implement an incremental optimization for MILP - python

I am trying to implement an incremental optimization where I can feed my MILP model with new constraint/variables and remove some other constraints/variables as time passes. Not to mention solved variables should be treated as fixed values as long as they are not removed.
My question is if there is a standard way/tools to do it?
What I thought about so far is to manipulate GAMS sqlite database using python, any better idea?
It is fine to use other environments.
I appreciate any clue to implement such thing. Thanks

Related

How to use Python to optimize an objective function with multiple terms (SVM Dual Problem)?

I am trying to find the solution for the following SVM dual problem using python. The problem is formatted as a quadratic programming problem:
I have been trying to use the Python library, CVXOPT, but according to its docs, and this example, It can only solve SVM problem in the form of:
Which would work fine for problems in the form of:
However, the problem I am trying to solve has two extra terms at the end (first image).
I am wondering how I can adjust the way my problem is formulated such that it is able to be solved with CVXOPT or any other python optimization package.

Search Strategies for MIP solver OR-tools in Python

I'm currently solving a shift assignment problem in OR-tools in Python, using a MIP solver, one employee at a time. For each seperate problem there is one employee and around 100 shifts. There are a lot of variables and constraints (few 1000's per employee). I've already looked in detail on how to improve each constraint, but no luck. Since the performance is really important, I wanted to further investigate the possibilities to adjust the search strategies, but no luck either. It seems that the documentation is sparse.
Can anyone help me by giving me some options to look into?
This is the solver I'm using:
pywraplp.Solver.CBC_MIXED_INTEGER_PROGRAMMING
Thank you in advance. Let me know if there is any information I need to add here.
You are out of luck. There are no customisation available for the search through the linear solver wrapper.
I would suggest using the CP-SAT for this.
You can have a look at:
https://github.com/google/or-tools/blob/master/examples/python/shift_scheduling_sat.py

Genetic Algorithm for Hybrid Flowshops Scheduling using Python

I apply optimization tool to solve pratical production planning problem.
My current problem is doing planning for a factory with various items in a unique production flow stage. In each stage, there are few parallel machines as graph below.
I have done maths MILP model, and try to solve by CPLEX but it too hard to handle the big scale model by itself.
Currently, I prepare to use Genetic Algorithm to solve it, but don't know where to start.
I have some knowdlege in Python Language. My friends, please advise how I start to deal with this problem?
Do someone have a similar solved problem with code, that I can have a reference?
Before you start writing code(or using someone else's) you must understand the theory behind the scene.
What are the main entities of your Production System?
You need to formulate optimization objectives,optimal schedule but defined in terms of optimization problem.
One example that comes to my mind
https://github.com/jpuigcerver/jsp-ga
Take a look at this thesis
http://lancet.mit.edu/~mbwall/phd/thesis/thesis.pdf

Is there python library that can learn the parameters of a given dynamic bayesian network?

As the title said, what I need is a python library not Matlab's BNT.
BNT is quite strong, but most of the time, I use python to clean data, and recently I found that use two different language to do one thing usually make the problem much more complex. So I want a python library that can fit the parameters of DBNs.
Thank you very much.

how can I specify the linear programming I have created to be maximizing or minimizing programming with lpsolve

I am learning to use lpsolve in python to solve the linear programming, I followed the website, and it worked well. But I could not find where to set the max/min attribute in LP problem, it has tortured me for some days.
taking a quick look, it seem to me you need to use set_maxim and set_minim, as in here. from python code it would be:
lpsolve('set_maxim', lp)
or
lpsolve('set_minim', lp)

Categories