Questions tagged [java]

For questions about solving Operations Research problems using the Java programming language.

Filter by
Sorted by
Tagged with
1
vote
0answers
50 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
1answer
67 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
0answers
37 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 ...
4
votes
1answer
168 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
0answers
40 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
1answer
137 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
3answers
90 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) ...
2
votes
0answers
80 views

How do I learn and use optaplanner ? any detailed tutorials/videos available online apart from the ones in optaplanner website?

I have a beginners level knowledge in Java , I am trying to learn optaplanner , can anyone help me finding the right resources to learn optaplanner and spring/springboot integration ,since my ...
2
votes
1answer
88 views

ALNS java code with the roulette-wheel-selection?

Currently I am coding the ALNS algorithm for the vehicle routing problem . I am stuck in the operator selection phase, I did not understand how I can apply this formula: $$p_i=\frac{f_i}{\sum_{j=1}^...
5
votes
1answer
73 views

Java in OR: Which non-constraint solving libraries do you use?

If you're programming OR challenges in Java, besides using constraint solvers, which other libraries do you typically use? Maybe for common tasks such as data reading, etc. Why? How do they make your ...
3
votes
1answer
155 views

Implementation of Local Branching

I've been recently reading some papers where the authors use local branching specifically in Benders Decomposition (see for reference). Although I understand up to some extend how the algorithm works, ...
3
votes
1answer
43 views

How can I change decision variable type in Concert Technologies (with Java)

I have a MILP model with continuous variables ($y_{ij}$) and binaries ($x_{ij}$). I am using Java and cplex 12.8 for implementation. Is there a way by which - using the Java-cplex API - I would be ...
1
vote
0answers
70 views

Fixed cost associated to SlackVar(waiting time cost) [CVRPTW]

I'm modeling a CVRPTW with some features: Each type of vehicle has a cost per km and a fixed cost per trip. To calculate these costs, I am using these methods for this: ...
6
votes
1answer
519 views

Solution time out for VRPTW in or-tools

I am experimenting around with or-tools and somehow I can't get a solution for the VRPTW problem for any of the instances I have tested from Gehring & Homberger ...
11
votes
1answer
392 views

k-means/k-medoids Clustering Implementation in CPLEX Java

I am trying to model a grouping algorithm as k-means clustering problem, by referring to the general definition as mentioned in Wikipedia. In my system, I have $N$ nodes that I want to group in $m$ ...
7
votes
0answers
64 views

Which Constraint solver is extensible to CSP algorithms?

I am novice to constraint programming and I need to implement the following algorithms. Backtacking Conflict-based backjumping AC partial lookahead MAC Forward checking Forward checking + dom ...
5
votes
0answers
77 views

Understanding HardRouteConstraint

I am trying to understand the route constraints in jsprit. While I got the concept of HardActivityConstraint, I am unable to have clarity on HardRouteConstraint. Can someone, preferably with a simple ...
8
votes
0answers
70 views

Multiple shipments with FILO order

I am trying to solve a problem statement with the help of jsprit. There is a depot. Identical items need to be delivered or picked up. An item can have two states: Bad or good. Bad items need to be ...
3
votes
2answers
286 views

Find all Combinations of a Matrix

I have a $16\times11$ matrix and want to find all eligible* combinations of this matrix including always entities from all 11 columns. A simple example from a $2\times3$ matrix would be the following:...
11
votes
2answers
425 views

CPLEX Auto-Benders: How do I get the number of optimality and feasibility cuts?

I am using CPLEX's 12.9 auto-Benders decomposition feature (from the CPLEX Java API). Following the documentation I let CPLEX decide the decomposition strategy as ...
7
votes
2answers
190 views

CPLEX CP Optimizer Java API function missing

I can not seem to find the needed functions to model the following problem through the Java API (CP Optimizer): a machine that has downtime and sequence-dependent setup times, with the extra ...
7
votes
1answer
207 views

Program can't stop when using callback of usercut in CPLEX to solve a branch-and-cut problem

When I tried to use Java to call CPLEX and use callback functions to solve a VRP problem with branch-and-cut, some problems emerged. I took out the subtour elimination constraint from the original ...
9
votes
4answers
1k views

Solving MIP in Java with free software

I would like to solve mixed integer programs in Java. I need an approach that relies purely on software that is free (not only for academic use, but also for people outside academia). What would be ...
8
votes
1answer
388 views

Java source code for branch and price

Is there any Java source code (or framework) to implement and solve MILP using the branch and price method? AFAIK, jORLib is a framework to implement B&P using Java, but it does not have any ...