Questions tagged [java]
For questions about solving Operations Research problems using the Java programming language.
32 questions
2
votes
1
answer
325
views
Solver-agnostic Modeling Language in Java
Some good solver-agnostic modeling packages in Python are Pyomo and PuLP, with Pyomo being a little more versatile than PuLP. What are the equivalent non-commercial and well-supported solver-agnostic ...
3
votes
1
answer
152
views
Efficient modelling via Gurobi
I would like to model the following constraint set in gurobi-java.
\begin{equation}
t^n_{ij} \geq t^n_{(i-1)j}+S_{(i-1)j} - (1 - \sum_{\substack{m \in \mathcal{M} \\ G_{ijm} = 1}}\sum_{k \in \mathcal{...
6
votes
8
answers
4k
views
Ideal programming language for an operations researcher
No single programming language will meet every need. However, there should be a language that most operations research scientists prefer to master.
I have coded different algorithms in Matlab and ...
2
votes
1
answer
511
views
CPLEX stuck in solve method - dual simplex solved model
I am solving a (rather large) MILP in CPLEX in Java. I also wrote a solution extractor method, which works most of the time. However, when CPLEX tries to solve my problem with the dual simplex method ...
2
votes
0
answers
123
views
MIP start in cplex using Java
When I am reading an "lp" file for the problem and using a MIP start reading from a "sol" file it works.
But when I pass on the same model directly to cplex (without writing lp) ...
2
votes
1
answer
313
views
RAM overflow when scheduling 1000+ intervals
Due to the answers to this and this questions, I was able to find the optimal solution for scheduling problem. However, if there are many tasks that must be scheduled, e.g. 1000+, then the solver ...
3
votes
1
answer
511
views
Force gaps between tasks, tasks are scheduled within their job's time windows in Jobshop problem
The problem I'm trying to solve is a modification of the original Jobshop problem. The additional constraints are:
There is only one machine for all jobs and their tasks.
Each job has a priority (...
0
votes
0
answers
124
views
Decision tree for a decision analysis to identify a strategy to reach a goal
I want to develop a script for a decision tree, which I already know its structure, like a flowchart in which each internal node represents a "test" on an attribute (e.g. whether a coin flip ...
1
vote
0
answers
156
views
Binary variable with two criteria in Gurobi (Java)
I have the following problem in Gurobi (Java).
I have a binary variable $b$ that is supposed to be $1$ or $0$ depending on my optimisation variable $x$. It should be true that $b = 1$ if $c_1 \le x \...
2
votes
1
answer
235
views
CPLEX Indicator Constraints in Java API
I'm using the Java API of CPLEX (12.6.1 version) to solve a MILP problem.
This is how I create 'normal' constraints:
...
0
votes
0
answers
94
views
linear equation with conditions in Java
I have the following problem:
I want to determine a linear equation for a data table with $x$ and $y$ value. Point 1 should be the point where the first time $y > 0$ and point 2 should be the point ...
5
votes
1
answer
705
views
how to implement an optimization function with polynomial in Gurobi (Java)
I have the following problem:
I have an objective function with the optimization variable $x$, which looks simplified like this:
$ZF = (a+b)*(x+1)$
Here $a$ is simply a constant value.
However, behind ...
0
votes
0
answers
87
views
Linear equation from pairs of values with conditions in Gurobi (Java)
How can I create a linear equation in Gurobi (Java) from values (x-y value pairs) that also has the following properties:
$\forall x \leq 0 \Longrightarrow y = 0$
The linear line/equation should have ...
0
votes
1
answer
546
views
if-else query depending on optimization variable in Gurobi (Java)
I am looking for the most elegant solution to the following problem:
I have an if-else query that depends on my optimization variable $x_i$.
If $a \leq b_i + x_i$, the parameter $c$ should take the ...
2
votes
3
answers
209
views
Link a binary variable to continuous variable in Java Gurobi
I have the following problem:
Depending on my continuous optimization variable $S_m$, I would like to introduce a binary variable $x_m$, which, depending on the value of $S_m$ (greater or less than 0) ...