Here is my the optimization problem I want to solve. I want to add a new constraint which is the following:
The goal of this new constraint is to ensure that our user basket does not contain similar (redundant) products.
How can I add this constraint, if we suppose that I have a similarity function called similarity(product1, product2) that takes as argument two products and gives as a result the similarity between them.
Thank
Let me share an example. Compared to the previous model I shared you could add:
float similarity[i in allProducts][j in allProducts]=
abs(ord(allProducts,i)-ord(allProducts,j));
float sim=4;
before the subject to block and then:
ctSim:
forall(ordered i,j in allProducts) z[i]*z[j]*similarity[i][j]<=sim;
}
in the subject to block.