I have variable gamma indexed by a two-dimension list base_M (e.g. [1, 1], [1, 2], ..., [20, 2])
gamma = m.addVars(base_M, lb = gamma_lb, ub = gamma_ub, vtype = GRB.BINARY, name = 'gamma')
I am wondering is it possible to get all variables once by calling something like getVarByName('gamma') . I understand that we can get each variable one by one by calling getVarByName('gamma[1, 1]'), getVarByName('gamma[1, 2]'), ..., but this is cumbersome
Please sign in to leave a comment.