What algorithm is used for my optimization?
AnsweredDear Community,
I have inserted my model into Gurobi and had it solved. Now I am wondering what algorithm is actually used for my problem. Since I only have continuous variables and have converted my exponential functions to linear functions, I expected gurobi to use the concurrent method for continuous problems. Looking at my output, gurobi finds integer variables after presolve and therefore applies the branch-and-bound algorithm, is this correct? Why is this the case?
Thank you very much!
c = 1
k = 2
a = 0.05
b = 1/500
T = 8*60
e = 5
num_work = k+1
num_bre = k
m = Model("Optimization")
m.params.NonConvex = 2
t = m.addVars(num_work, lb=0, ub=T, name="work")
u = m.addVars(num_bre, lb=0, ub=T, name="break")
r = m.addVars(num_work, lb=0, ub=c, name="work rate")
z = m.addVars(num_bre, lb=0, ub=c, name="work rate break")
#exponential functions
l = m.addVars(num_work, lb=-GRB.INFINITY, name="exponent")
y = m.addVars(num_work, name="e-Funktion")
w = m.addVars(num_bre, lb=-GRB.INFINITY, name="exponent2")
p = m.addVars(num_bre, name="e-Funktion2")
#objective function
q = m.addVars(num_work, name="Objective Function")
FuncPieces = -1
FuncPieceError = 0.09
#constraints for fatigue
m.addConstrs((-b * t[i] == l[i] for i in range(num_work)), name="fatigue")
for i in range(num_work):
m.addGenConstrExp(l[i], y[i], name=f"fatigue_exponential_{i}")
#constraints for recovery
m.addConstrs(((-a) * u[i] == w[i] for i in range(num_bre)), name="recovery")
for i in range(num_bre):
m.addGenConstrExp(w[i], p[i], name=f"recovery_exponential_{i}")
m.addConstr(1 == r[0])
for i in range(num_bre):
m.addConstr(r[i]*y[i] == z[i])
for i in range(num_bre):
m.addConstr((z[i]+(c-z[i]) * (1-p[i])) == r[i+1])
m.addConstr((quicksum(t[i] for i in range(num_work)) + quicksum(u[i] for i in range(num_bre))) <= T)
m.addConstr(((quicksum(u[i] for i in range(num_bre))) >= 0))
m.setObjective(quicksum((r[i] - r[i]*y[i])/b for i in range(num_work)), GRB.MAXIMIZE)
m.optimize()
Output 1.part:
Model has 3 quadratic objective terms
Model has 4 quadratic constraints
Model has 5 general constraints
Variable types: 23 continuous, 0 integer (0 binary)
Coefficient statistics:
Matrix range [2e-03, 1e+00]
QMatrix range [1e+00, 1e+00]
QLMatrix range [1e+00, 1e+00]
Objective range [5e+02, 5e+02]
QObjective range [1e+03, 1e+03]
Bounds range [1e+00, 5e+02]
RHS range [1e+00, 5e+02]
QRHS range [1e+00, 1e+00]
Presolve added 78 rows and 1533 columns
Presolve time: 0.03s
Presolved: 100 rows, 1557 columns, 29313 nonzeros
Presolved model has 4 bilinear constraint(s)
Variable types: 1522 continuous, 35 integer (7 binary)
Root relaxation: objective 4.094919e+02, 129 iterations, 0.02 seconds (0.01 work units)
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 409.49186 0 5 - 409.49186 - - 0s
H 0 0 312.9253998 409.49186 30.9% - 0s
H 0 0 315.9124841 409.49186 29.6% - 0s
H 0 0 320.9946870 409.49186 27.6% - 0s
0 0 403.75504 0 7 320.99469 403.75504 25.8% - 0s
0 0 403.75504 0 7 320.99469 403.75504 25.8% - 0s
0 0 403.75504 0 7 320.99469 403.75504 25.8% - 0s
Best,
Elina
0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Cross-posted here.
0
Post is closed for comments.
Comments
2 comments