Hi,
I am trying to write an objective using index for each element of an expression, just like a simple constraint (example: i, h, k in @constraint(model1, con19B[i in V0_customer, h in Vstation, j in V0_customer, k in B], z1[i,h,j,k] <= y[h])
However, I cant find how to do it. My example below is not working:

@objective(model1, Min, [g in VArc_dummy_length, k in Vdominante_length],
sum(x[Arc_dummy[g][1],Arc_dummy[g][2],Arc_dummy[g][3]]* Mtime[Arc_dummy[g][1],Arc_dummy[g][3]]))
+ sum(x[Arc_dominante_strg[k][1],Arc_dominante_strg[k][2],Arc_dominante_strg[k][3]]* Mtime[Arc_dominante_strg[k][1],Arc_dominante_strg[k][2]]
+ x[Arc_dominante_strg[k][1],Arc_dominante_strg[k][2],Arc_dominante_strg[k][3]]* Mtime[Arc_dominante_strg[k][2],Arc_dominante_strg[k][3]])
+ sum(Δ[Arc_dominante_strg[k][1],Arc_dominante_strg[k][2],Arc_dominante_strg[k][3]])

Hi @odow , is not exactally to sum over those element index.
I want something like this ilustrative example:
Vtotal =[1, 2, 3, 4, 5]
Vstation = [4,5] @variable(model1, x[i in Vtotal, h in Vstation, j in Vtotal], Bin)

V1 = [ [1,5,2] [1,4,2],[2,5,1],[3,5,2]] #V1 is a subset of specific arcs index

#The objective function should sum only over the specific arcs index at V1 @objective(model1, Min, x[1,5,2] + x[1,4,2] + x[2,5,1] + [3,5,2])

I don’t really understand how that example matches your previous example, but as a general rule, your objective should return a scalar. You can’t write something like:

@objective(model1, Min, [g in VArc_dummy_length, k in Vdominante_length], ... )