Questions tagged [docplex]

docplex (a.k.a. IBM® Decision Optimization CPLEX® Modeling for Python) is a Python modeling API that provides modules for mathematical programming via CPLEX and constraint programming via CP Optimizer.

316 questions
0
votes
2 answers

Save Visu gantt chart output to a .png file

import docplex.cp.utils_visu as visu In a Constraint programming docplex code I have been able to show a gantt chart using visu.I can show that gantt using Visu.show() I need to save this output as a .png file.Is there any thing I can do.
suresh_chinthy
  • 377
  • 2
  • 12
0
votes
2 answers

doopl bin directory path

I added the bin directory path of opl on system environment setting. Following is the path. C:\Program Files\IBM\ILOG\CPLEX_Studio1210\opl\bin\x64_win64 However, the doopl keeps giving me error like below File…
0
votes
1 answer

Adding multiple quadratic constraints in DOCPLEX

I am trying to add quadratic constraints to a docplex model however it is interpreting them as linear and giving me error messages. below is a excerpt from the script here is the quadratic constraint: mdl.add_constraints((mdl.sum(Allocation[o,p] *…
0
votes
0 answers

Adding a path linking docplex to python3

I am installing Cplex python API into my MacBook. So I followed the tutorial given in YouTube (https://www.youtube.com/watch?v=oINxanpv_2M) and have installed the script & library for Cplex using the Terminal instructions: cd…
LuciaEv
  • 13
  • 4
0
votes
1 answer

only print the solution in docplex solve()

Using from docplex.cp.model import CpoModel I have written a docplex code. Model defenition is as follows. mdl = CpoModel(name="HouseBuilding") But by the solve() function it is printing unnecessary output with the solution at last. msol =…
suresh_chinthy
  • 377
  • 2
  • 12
0
votes
2 answers

Export DOcplex model output to Excel using pandas

I have the following solution of a model trans using DOcplex in python: # Solve command solution = mdl.solve(log_output=True) solution.display() #printed solution solution for: transp objective: 73231116.000 q_Coupe 1_Smithton = 6000.000 q_Coupe…
0
votes
1 answer

getting result from doopl in python

Hi I'm using doOPL in python. The following is part of my code. with create_opl_model(model="phase0.mod",data="prob1.dat") as opl: # tuple can be a list of tuples, a pandas dataframe... # Generate the problem and solve it. start_time =…
0
votes
1 answer

Why my cplex constraint makes my model slove slower?

I have an MILP model that I am trying to solve. I have a new constriant that I explained before on this question My new constraint is : if: y[(i,j,k)]==1 then : y[(j,i,k+1)]…
Sana.Nz
  • 81
  • 11
0
votes
3 answers

How to combine 2 constraints to minimise cost and maximise capacity using DOcplex.mp in Python

I have the following OF to minimize the cost of supply chain: mdl.minimize(mdl.sum((cs+ch+cf+cv*d[j])*q[j] for j in arcs) + mdl.sum(α*(eh+et*d[j])*q[j] for j in arcs) + mdl.sum(β*(gh+gt*d[j])*q[j] for j in arcs) + mdl.sum(X[f]*cjf for f in…
0
votes
3 answers

IBM cplex ilog VS docplex in python

Currently, I'm working on docplex on python. I just found out that result from IBM cplex Ilog and docplex is way different. Even though their constraints, objective function, everything are identical, their solution is very different. In some cases,…
0
votes
0 answers

Why cpx.populate_solution_pool() takes so much time to run?

I have a MILP model that I run on cplex python API. When I use "cplex.populate_solution_pool()" it takes almost 50 minutes to run which is very long for me. How can I speed up running this command?
0
votes
1 answer

Turning a Tkinter (along with other modules) Python code that uses CPLEX into an executable

I have this Python 3 code that uses Tkinter, numpy, pylab, os ast, and matplotlib, along with CPLEX and some files (txt and png) to solve a type of Vehicle Routing Problem and I would like to turn into an executable (never done it before). I tried…
Samji
  • 1
  • 1
0
votes
2 answers

Issue with accessing different types of variable values in cplex solution pool

I have this MILP model that I am solving by cplex python API: def CModel(): mdl=Model('Generate') #variable declaration y=mdl.binary_var_dict(ijk,name='y') Sum=mdl.integer_var_dict(ij,name='S') #objective …
Sana.Nz
  • 81
  • 11
0
votes
1 answer

how do I fix the docplex error? It works well in CPLEX

I'm attempting to create a set of constraints about the simple VRP problem. I've tried add_constraint but I'm getting an invalid syntax error How can solve the problem?? Now I use add_constraint, and My error and code is something like below. from…
0
votes
1 answer

CPLEX with anaconda/python academic version

i have installed the CPLEX optimization studio (academic version) and currently looking for a way to access it through anaconda/python. Anyone has some insights? thanks!