[FlopCpp] one constraint ..??
Martin Grados Marquina
themartininf at gmail.com
Tue Apr 22 23:51:28 EDT 2008
i have one constraint that i dont know how model, ie, inside of my
constrainr i want to subtraction the elements of a set with one's data's,
for example
MP_set V; // set of vertices
MP_set F; // set of frequencies
MP_subset<1> vert(V);
MP_subset<1> freq(F);
vert.insert(1); ... vert.insert(3);
freq.insert(16); freq.insert(30); ... freq.insert(916);
MP_subset<2>
Eeq(I,I), // Arc between the vertice vi and vj for Equation
Ein(I,I); // Arc between the vertice vi and vj for Innequation
MP_data
deq(Eeq), // distance between the vertice vi and vj for Equation
din(Ein); // distance between the vertice vi and vj for Innequation
MP_subset<2> vertFreq(I,F);
forall(varD(v,do1)*dom_i(do1,f), vertFreq.insert(v,f)); // Assign the
frequencies to each vertice
MP_binary_variable Xvf(vertFreq), y(freq);
MP_constraint
assignOneFreq(vert), // only one freq to every vertice
freqToAllVert(freq), // freq could be to assign to all the vertices
cstToVertEeq(freq,Eeq), // assign two freq which |f +- g| = d(E(vi,vj))
// MY CONSTRAINTS
assignOneFreq(vert(v)) = sum(freq(f), Xvf(vertFreq(v,f))) == 1;
freqToAllVert(freq(f)) = sum(vert(v), Xvf(vertFreq(v,f))) <=
I.size()*y(freq(f));
// ************** THIS IS MY PROBLEM, I DONT KNOW HOW BUILD THIS
***********
// I WANT TO DO IS:
/*
assign to frequency "f" to a vertice "vi" or "vj" if for all "f" that belong
to the set of Frequencies and for two vertices adjacents "vi" or "vj" that
belong to the set of Vertices, exits one constraint that satisfed: to assign
"f" to "vi" or "vj" only if the frequency had one distance to them of more o
minus "dij" ( ie, f +- d(E(vi,vj) )
*/
cstToVertEeq(freq(F), Eeq(vi,vj)) = Xvf(vertFreq(vj,F)) == Xvf(vertFreq(vi,
F-deq(Eeq(vi,vj)) )) + Xvf(vertFreq(vi, F+deq(Eeq(vi,vj)) ));
// THIS CONSTRAINT "cstToVertEeq" IN THE VERSION 1.0.2 REPORT ME ONE ERROR,
please help me to correct this constraint, Its very
important i dont have time
Thank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/flopcpp/attachments/20080422/c8bc71ae/attachment-0001.html
More information about the FlopCpp
mailing list