I have a dataset having item_id as a column, where item_id ranges from 1 to 10, i want to select some of them based on some constraints in the optimization model. I defined a binary variable Yi={0,1} to decide which are selected and which not based on other constarints. Now I have another dataset, having 2 columns item_id1 and item_id2, both have item ids from 1 to 10 only. Eg dataset: Item_id1 Item_id2 1 2 2 5 3 7 4 1 5 2 and so on Now, i have to impose 1 more constraint that if any value from item_id1 is selected, then corresponding value from item_id2 is also selected, else both are not selected. In other words, if 1 is getting selected, then 2 is also selected. If 2 is getting selected, then 5 is also getting selected. And i want to do that using only 1 binary variable Yi, to write that as a constaraint in the optimization model.
... View more