returned solution is not optimal
AnsweredI solved problem with 844 binary variables. It is the first task I formulated in Gurobi. I was using the R package. The problem has 28 inequalities and 211 equations. I would check the correctness of the model in LPsolve. Still, the MPS file that I generated from Gurobi was not readable by LPsolve, probably because the coefficients from Gurobi had too many decimal places, and these numbers did not fit into the prescribed number of places for MPS columns. I think I have formulated the problem correctly, gurobi calculates something, which is not complete nonsense, but I can see that I can improve its solution manually. I want to ask if there is a default number of iterations or some precision set in Gurobi, so it quit computing before finding the optimal solution and if I should change it. I will send you my code and the model itself if someone can take a look at it, but for now, I am sending only the commands I used in R to build and run the model. Because I still think that maybe some parameters would be enough to increase the solution accuracy:
library(gurobi)
M <- list()
M$A <- rbind(L,L1)
M$obj <- OF
M$modelsense <- 'min'
M$rhs <- c(P,P1)
M$sense <- c(rep('<',nCiest), rep('=',nLinks))
M$vtype <- "B"
result <- gurobi(M)
Thank you,
Milan
-
Hi Milan,
You could use the gurobi_write() function to generate a human-readable LP file which you can then analyze by hand to check whether the model looks what it should like.
You could try setting the MIPGap parameter to 0. This will force Gurobi to search for a true global optimum.
Best regards,
Jaromił0 -
Hi Jaromil,
I tried writing to lp already and didn't find the error, but your advice about the MIPGap parameter helped. Thanks for your help!
Milan
0
Please sign in to leave a comment.
Comments
2 comments