I am coding a MIP problem in docplex and I would like to ask for some tips.
I would like to input a binary parameter that states a compatibility relation:
I have a set of characteristics $H$ to be satisfied in a product. The product is made by a set of components $C$ and each component can have many variants $V$. For stating the compatibility between variant of component and required characteristics, I stated the following binary parameter:
- $G_h{_{c}}_{v}=1$ if the characteristic $c$ can be accomplished by variant $v$ of component $c$, and zero otherwise
I was wandering to use a 3D numpy array to state this relation. But I if I'm not wrong, I did not find examples using 3D numpy array. Instead, I saw namedTuple
, that I guess was used to state similar relation for string elements.
How can I code binary parameters in docplex keeping the index of each element, by accessing the value of each parameter and also its key ?
If someone could help me, I will be very grateful.