$title kvadraticka s omezenimi

$offsymxref


set B barvy /bar1*bar12/
    V vrcholy /1*22/;

parameters o(V) jedna barva /(1*22) 1/
           g gamma /1000/;

binary variable X(B,V);
variable obj;



table matice (V,B,V) matice s penalizacemi Q
$include "C:\Users\Mountain Home BX\Desktop\mereni\postihyQ17.txt"

alias (V,vrch)

equations objectivef ucelova funkce;
objectivef.. obj =e= sum(vrch,sum(B,sum(V,X(B,vrch)*matice(vrch,B,V)*X(B,V)))) +

g*(sum(V,(sum(B,X(B,V))-o(V))*(sum(B,X(B,V))-o(V))));

model graf /all/;

OPTIONS optcr=0.000001
reslim = 900;
solve graf minimizing obj using MIQCP;

display obj.l;
