Questions tagged [pyscipopt]

Used for all problems and questions regarding PySCIPOpt, the Python interface to the SCIP Optimization Suite.

PySCIPOpt is the Python interface to the SCIP Optimization Suite for modeling and solving MINLP problems.

Installation via PyPI or conda:

  • pip install pyscipopt
  • conda install pyscipopt
37 questions
0
votes
0 answers

Cant install pyscipopt in windows

I am trying to do linear programming in python and want to use the PyScipOPT library. I have done these steps: Download the SCIPOptSuite Updated my path environments set SCIPOPTDIR correctly ran pip install pyscipopt Terminal output × Building…
0
votes
0 answers

Finding the minimum of two function in pySCIPOpt

I have the following function: $$ \max_{n_j} \sum_{j \in J_i} min( b(n_j) , Q - \sum_{k < j} b(n_k) ))$$ From my understanding minimum function is not implemented in PySCIPOpt, thus I wrote minimum as $$ min(a , b) = \frac{(a + b - |a - b|)}{2}.…
Andrea Fresa
  • 351
  • 2
  • 18
0
votes
0 answers

MILP pyscipopt / pulp: how to encode movement on a 2D grid where some movements are not allowed

I am working on solving a MILP problem using SCIP. The problems alloes movement on a 2D grid at max one horizontally / vertically or diagonally per time unit. I have encoded this as follows. model.addCons(x - x_previous <= 1) model.addCons(y -…
rhedak
  • 399
  • 4
  • 13
0
votes
1 answer

Get solution value of variable by name in pySCIPopt

I want to get the solution value of a model variable by name in pySCIPopt. It should be something like model.getSolByName("x"). Is this possible? (I didn't find anything like this.) I wrote my own child class of Model to do this, but wonder if there…
Michael Hecht
  • 2,093
  • 6
  • 25
  • 37
0
votes
0 answers

Pyscipopt (in Google Collab) does not show/print any output for the large-size network optimization problem in Google Collab

I am working on a non-linear network-optimization problem. When I run a large problem instance on the lab high-performance computers (imposing the time limit of 1 or 2 hours), those computers give me the output when the time is exhausted. I wanted…
0
votes
1 answer

Writing an MPS I get "OS Error: SCIP: cannot create file!"

I was trying to write an MPS using pyscipopt.writeProblem() but I am getting this error, which I had never gotten before and there does not seem to be any information available other than what its message says. Is there any problem with…
0
votes
1 answer

force early exit in SCIP branch-and-bound

When using custom branching or node selection rules in SCIPopt, is it possible to force an immediate exit of the branch-and-bound search once a certain known solution is found? I want to say that a specific node is the solution that I want to take,…
Brannon
  • 5,324
  • 4
  • 35
  • 83
0
votes
1 answer

compute the tableau's nonbasic term in SCIP separator

In traditional Simplex Algorithm notation, we have x at the current basis selection B as so: xB = AB-1b - AB-1ANxN. How can I compute the AB-1AN term inside a separator in SCIP, or at least iterate over its columns? I see three helpful methods:…
Brannon
  • 5,324
  • 4
  • 35
  • 83
0
votes
1 answer

custom cutter has invalid Lhs or Rhs

I'm trying to write a custom separator (aka, MIP cutter) to my SCIP model (in Python). To do this I need to detect which constraints are tight/binding at the given MIP node. I thought that I could do this by comparing LHS to RHS on the rows (aka,…
Brannon
  • 5,324
  • 4
  • 35
  • 83
0
votes
0 answers

Why don't I get a solution when adding x >= A constraint in pyscipotp?

Adding a simple example (working on much harder but the problem is the same) - it's price/profit optimal combination. When I add this constraint everything breaks (simple constraint to x > A) for j in range(N): model.addCons(x[j] >=…
0
votes
1 answer

Can I set the SCIP constraint handler to work only after a feasible solution is found?

I read the SCIP constraint handler documentation, and reads that CONSHDLR_CHECKPRIORITY= -1 makes that the constraint handler only works when the solution is integral. However, my handler is still adding constraints before finding a feasible…
0
votes
1 answer

How to use PySCIPOpt with gurobi solver?

I use SCIP because it has nice branching tools like handler, but the solver is not as fast as I would like. I got access to gurobi (and maybe cplex) because I know they can work together, but have no idea. Disclaimer: I have use cmake and install…
orpanter
  • 115
  • 6
0
votes
1 answer

Changing a parameter while branching in SCIP

I use pyscipopt. I know how to add constraints while branching using handlers (kind of), but now I also want to change some parameters. I imagine that is similar, but couldn’t found an example. What I want is as follows: -Every time a feasible node…
0
votes
0 answers

Constraints with Binary Variable Resulting in Pyscipopt Breaking

I'm trying to add a series of constraints which make use of an indicator function, but it seems to be breaking the solver. This is the original formulation of the constraint: Which has to be broken down into a form suitable for Pyscipopt: I'm…
0
votes
1 answer

Best way to implement a primal heuristic that fixes certain Variables

I am using PySCIPOpt and have a MIP with some quadratic constraints (works). Now, I want to implement a Primal Heuristic (should run once before presolving), that fixes certain Variables and optimizes afterwards. Ìn pseudo-code something like: For x…
S.M.
  • 3
  • 1