# How do I get each row maximun value(or second maximun) after a Mvar object matrix product a constant matrix

Hi, I currently woking on a problem, where X is an M*N Mvar object with all elements are binary, B is a constant matrix with shape M * 720, and C is also a constant matrix with shape 1*N.

By using Python numpy library, my objective can be expressed with the code like below:

`min C@np.max(X.T@B, axis=1)`

Note: X.T means the transpose of Mvar object. @ means matrix product.

My question is how can i express this objective by using gurobipy, or more further how can i get the second maximun even third maximun value each row of the product X.T@B with gurobi.

Any help would be much appreciated !

0

Please sign in to leave a comment.

## Comments

0 comments