# Questions tagged [java]

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

22 questions
Filter by
Sorted by
Tagged with
0answers
36 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 ...
1answer
146 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 ...
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 ...
1answer
121 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 ...
3answers
74 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) ...
0answers
51 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 ...
1answer
56 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}^...
1answer
70 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 ...
1answer
144 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, ...
1answer
40 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 ...
0answers
66 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: ...
1answer
463 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 ...
1answer
350 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$ ...
0answers
63 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 ...
0answers
71 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 ...
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 ...
2answers
222 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:...
2answers
394 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 ...
2answers
187 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 ...
1answer
197 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 ...
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 ...
1answer
360 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 ...