Originally posted by: kanamitz@jp.ibm.com
How can I write objective function to minimize variation.
Problem:
There is a (n, m) matrix with binary value(0,1) which describe option of choices.
And their rows have a category.
Constraint: Need to choose one option in a category.
Objective: Minimize variation of pattern chosen.
For instance
Input(row 1,2 are in category A, row 3-5 are in category B)
A 0 1 0 1
A 1 1 1 1
B 0 0 1 0
B 1 1 1 1
B 1 1 1 0
Expected Output
(Options are chosen in each category and chosen pattern variation are all same. so variation is one. )
A 0 0 0 0
A 1 1 1 1
B 0 0 0 0
B 1 1 1 1
B 0 0 0 0
I thought minimize sum_i,j,k (a_i,j&&a_k,j) should be okay but I don't understand how I can write that as a code.
#DecisionOptimization#MathematicalProgramming-General