我问这个问题是因为我仍然没有数据可以测试它!
我制作了一个模型,但我的目标函数太大,我有一个二次目标函数,带有一些约束,这些约束比通常的SVM更复杂。我使用了拉格朗日乘数,并且得到了以下obj乐趣: 现在,我想知道您是否是优化方面的专家,您认为通过此目标函数解决此问题是不可能的吗?我应该找到更好的方法?原始问题很平常,但是我读拉格朗日是更好的解决问题的方法。 请注意,变量只是L1,L2,L3,这是一个二次Obj函数
param w;
param n; #number of individual
param a1;
param u;
set M, default{1..w}; #set of modes
set N, default{1..n}
set A, default{1..a1};
set F, default{1..u};
set E, within F cross N;
param U{M,A,E};
param X{M,A,E};
param Y{M,E};
var W{M,A};
var B{M,A};
param gamma;
param d{E};
param g{F};
param P{E};
var K2{M,A,F};
var Q1{M,A};
var Q2{M,A};
var Q3{M,A};
var L1{M,E}; #Lagranj multiplier of first constraint
var L2{M,F}; #Lagranj multiplier of second constraint
var L3{M,E};
param C1;
param C2;
param C3;
maximize obj:sum{m in M,(f,i) in E}(L1[m,f,i])+sum{m in M,(f,i) in E}(g[f]*d[f,i]*L2[m,f])-1/2*(sum{m in M: m!=1 and m!=2}( sum{(f,i) in E, (r,j) in E}(L1[m,f,i]*Y[m,f,i]*(L1[m,r,j]*Y[m,r,j]*exp(-gamma*(sum{v in A} (X[m,v,f,i]-X[m,v,r,j])^2))
+ sum{(t,l) in E}(g[t]* L2[m,t]*d[t,l]*Y[1,t,l]*exp(-gamma*(sum{a in A} (X[m,a,f,i]-sum{k in N:k!=l}X[m,a,t,k])^2))
+ sum{(f1, i1) in E}( L3[m,f1,i1]*P[f1,i1]*exp(-gamma*(sum{v1 in A} (X[m,v1,f,i]-X[m,v1,f1,i1])^2))))))
+sum{(t,l) in E, (f,i) in E}(g[t]* L2[m,t]*d[t,l]*Y[1,t,l]*(L1[m,f,i]*Y[m,f,i]*exp(-gamma*(sum{v2 in A}(sum{i2 in N: i2!=l}X[m,v2,t,i2]-X[m,v2,f,i])^2))
+ sum{(t1,l1) in E}(g[t1]* L2[m,t1]*d[t1,l1]*Y[1,t1,l1]*exp(-gamma*(sum{v3 in A}(sum{i3 in N: i3!=l}X[m,v3,t1,i3]-sum{i4 in N: i4!=l1}X[m,v3,t1,i4])^2))
+ sum{(f1, i1) in E}(L3[m,f1,i1]*P[f1,i1]*exp(-gamma*(sum{v4 in A}(sum{i4 in N: i4!=l}X[m,v4,t,i4]-X[m,v4,f1,i1])^2))))))
+sum{(f1,i1) in E,(f,i) in E}(L3[m,f1,i1]*P[f1,i1]*( L1[m,f,i]*Y[m,f,i]*exp(-gamma*(sum{v5 in A}(X[m,v5,f1,i1]-X[m,v5,f,i])^2))+
sum{(t,l) in E}(g[t]* L2[m,t]*d[t,l]*Y[1,t,l]*exp(-gamma*(sum{v5 in A}(X[m,v5,f1,i1]-sum{i5 in N: i5!=l}X[m,v5,t,i5])^2))
+sum{(f4,t4) in E}(L3[m,f,i]*P[f,i]*exp(-gamma*(sum{v6 in A}(X[m,v6,f1,i1]-X[m,v6,f4,t4])^2)))))))+
sum{(f,i) in E, (r,j) in E}(L1[1,f,i]*Y[1,f,i]*(L1[1,r,j]*Y[1,r,j]*exp(-gamma*(sum{v in A} (X[1,v,f,i]-X[1,v,r,j])^2))
+ sum{(t,l) in E}(g[t]* L2[1,t]*d[t,l]*Y[1,t,l]*exp(-gamma*(sum{a in A} (X[1,a,f,i]-X[1,a,t,l])^2))
+ sum{(f1, i1) in E}( L3[1,f1,i1]*P[f1,i1]*exp(-gamma*(sum{v1 in A} (X[1,v1,f,i]-(U[1,v1,f,i]-X[1,v1,f1,i1]))^2))))))
+sum{(t,l) in E, (f,i) in E}(g[t]* L2[1,t]*d[t,l]*Y[1,t,l]*(L1[1,f,i]*Y[1,f,i]*exp(-gamma*(sum{v2 in A}(X[1,v2,t,l]-X[1,v2,f,i])^2))
+ sum{(t1,l1) in E}(g[t1]* L2[1,t1]*d[t1,l1]*Y[1,t1,l1]*exp(-gamma*(sum{v3 in A}(X[1,v3,t,l]-X[1,v3,t1,l1])^2))
+ sum{(f1, i1) in E}(L3[1,f1,i1]*P[f1,i1]*exp(-gamma*(sum{v4 in A}(X[1,v4,t,l]-(U[1,v4,f,i]-X[1,v4,f1,i1]))^2))))))
+sum{(f1,i1) in E,(f,i) in E}(L3[1,f1,i1]*P[f1,i1]*( L1[1,f,i]*Y[1,f,i]*exp(-gamma*(sum{v5 in A}((U[1,v5,f1,i1]-X[1,v5,f1,i1])-X[1,v5,f,i])^2))+
sum{(t,l) in E}(g[t]* L2[1,t]*d[t,l]*Y[1,t,l]*exp(-gamma*(sum{v5 in A}((U[1,v5,f1,i1]-X[1,v5,f1,i1])-X[1,v5,t,l])^2))
+sum{(f4,t4) in E}(L3[1,f,i]*P[f,i]*exp(-gamma*(sum{v6 in A}((U[1,v6,f,i]-X[1,v6,f1,i1])-(U[1,v6,f4,t4]-X[1,v6,f4,t4]))^2))))))+
sum{(f,i) in E, (r,j) in E}( L1[2,f,i]*Y[2,f,i]*(L1[2,r,j]*Y[2,r,j]*exp(-gamma*(sum{v in A} (X[2,v,f,i]-X[2,v,r,j])^2))
+ sum{(f1, i1) in E}( L3[2,f1,i1]*P[f1,i1]*exp(-gamma*(sum{v1 in A} (X[2,v1,f,i]-X[2,v1,f1,i1])^2)))))
+sum{(f1,i1) in E,(f,i) in E}(L3[2,f1,i1]*P[f1,i1]*( L1[2,f,i]*Y[2,f,i]*exp(-gamma*(sum{v5 in A}(X[2,v5,f1,i1]-X[2,v5,f,i])^2))+
+sum{(f4,t4) in E}(L3[2,f,i]*P[f,i]*exp(-gamma*(sum{v6 in A}(X[2,v6,f1,i1]-X[2,v6,f4,t4])^2))))));