Gurobi Error for bigger Models: Failed to create model (Java)
Awaiting user inputHello.
I have an Error when i try to run my program for bigger Models.
n<=4 ... it is working
n>4 ... it is not working
Error:
Exception in thread "main" gurobi.GRBException: Failed to create model
at gurobi.GRBModel.<init>(GRBModel.java:68)
at Chess_queenproblem.branchAndBound(Chess_queenproblem.java:82)
at Chess_queenproblem.branchAndBound(Chess_queenproblem.java:192)
..... [it is recursive so i have for each new tray the same error] ...
at Chess_queenproblem.main(Chess_queenproblem.java:53)
Warning: Failed to open log file 'LP.log'
Part of program:
public static void main(String[] arg) throws GRBException
{
//Parameter values
int n = 5;
private static Double[][][][] threatedFields = ....;
private static Boolean[][] fixedFields = ....;
//Start Groubi
env = new GRBEnv(true);
env.set("logFile", "LP.log");
env.set("OutputFlag", "0");
env.start();//Start Branch and Bound
//Start Branch and Bound
solution = branchAndBound(threatedFields, fixedFields,n); == Line 53
env.dispose();
private static boolean[][] branchAndBound(Double[][][][] threatedFields, Boolean[][] fixedFields, int n) throws GRBException
{
GRBModel model = new GRBModel(env);
GRBVar[][] x = new GRBVar[n][n]; == Line 83
... do optimization ...
boolean[][] solutionTrue = branchAndBound(threatedFields, fixedFieldsEnlargedTrue, n); == Line 192
Log:
Gurobi 9.5.1 (win64, Java) logging started Thu May 26 20:36:04 2022 >>> not working n=5
Gurobi 9.5.1 (win64, Java) logging started Thu May 26 20:36:04 2022 >>> working n=4
Set parameter LogFile to value "LP.log"
-
Did you check whether your program does run out of memory? This is often the case for recursive Java programs which require many objects of significant size, cf. StackOverflowError Vs OurOfMemoryError in Java.
Did you try re-writing your program in a sequential way to avoid recursion?
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment