I have a Matlab program that outputs some binary variables based on some constraints.
As an example with three n=3 bits, {x_1 x_2 x_3, x_4 x_5 x_6, x_7 x_8 x_9} my program will output all these bits based on the constraints.
At this point, I have no objective function.
However, the goal of the objective function is to minimize the total Hamming distance (HD) between some of the n bits pairs.
Say I want to minimize HD (x_1 x_2 x_3 vs x_4 x_5 x_6) + (x_1 x_2 x_3 vs x_7 x_8 x_9)
Needless to say, n can vary as can the number of pairs compared for HD.
How do I perform this with intlinprog? I am not finding this helpful. A little bit of direction would do. Do I need to change my A,b,Aeq,etc?