0

Trying to work with JuMP and Julia with Gurobi solver I would like to minimize a vector of variable, but can't figure it out how to formulize it.

I have where m is my model name and size_teachers an integer:

@variable(m, days_worked_vec[1:size_teachers], Int)

which is a size_teachers vector length, and I would like to minimize each items of this vector. I tried to define:

for teacher in 1:size_teachers
    @objective(m, Min, days_worked_vec[teacher])
end

But it made the root relaxation infeasible, leading to a non optimal solution (no calculation performed).

Anyone know or have a clue on how to setup the @objective to minimize each elements of a vector?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Celi28
  • 101
  • 13
  • 2
    You probably want to do a multi-objective optimization. In this case it is worth to investigate https://github.com/anriseth/MultiJuMP.jl package that is designed to handle such problems. – Bogumił Kamiński Dec 09 '18 at 10:27
  • Single objective optimization could also be used to optimize a decision vector of abitrary dimension – user172056 Dec 10 '18 at 08:37
  • @user172056 Can you explain how you would implement vector optimisation using a single objective ? When trying to pass a vector to `@objective`, it raise an error (int needed, not vect) – Celi28 Dec 10 '18 at 09:04

0 Answers0