我需要你的帮助。对于我的论文,我需要使用 Gurobi 解决具有二次约束的混合整数二次问题 (MIQP)。当我将问题写入文件时,实现很好,解决部分是问题,因为它的最佳界限和目标是 0 ...... 这不可能!问题的定义:
maximize: \sum_{i \in A, j \in Q} c_ij*x_ij
\sum_{i \in A} c_ij*x_ij <= B_i
c_ij <= b_ij
x_ij, c_ij >=0
Run Code Online (Sandbox Code Playgroud)
使用Java接口实现:
public class Gurobi_mod {
public static int m = 10; //number of items
public static int n = 5; //number of agents
public static double b_ij[][] = new double [n][m];
public static double B_i[] = new double [n];
public static void main(String[] args) throws IOException {
try {
GRBEnv env = new …Run Code Online (Sandbox Code Playgroud)