So I tried to model it in this “sandwich” approach from the acid-blending example. But there I can’t figure out how to model the constraints.

Would be great to have a hint.

]]>However, I’m surprised no one has yet caught the mistake (probably just a typo) in the formula for cosine similarity in the edge weights worksheet. The formula should be :

sumproduct(…) / ( sqrt(…) * sqrt(…) )

So there is an extraneous left parenthesis, and + should be replaced with *

In mathematical terms, the cosine similarity of two vectors u and v is :

dot_product(u,v)/(length(u)*length(v))

Obviously, cos_similarity(u,v) = cos_similarity(v,u)

which means the similarity matrix in the edge weights worksheet should be symmetric.