0

everyone. I formulate some formulas for my research. I want to ask is there any tool can solve this problem. I survey some tools such as GLPK, some MATLAB toolbox… But my formula seems to be nonlinear. I find some information on the Internet, it is one special case of integer programming called 0-1 integer programming.

My doubt is: can I put binary variable in the exponential like the following formula? And is it available using "product(pi)" when solving this problem? I survey some examples, but I didn’t find this two usages.

The variable is Xc,n,m,s,i. And, Lc,n, Tmax, Tm, Pm,s,i, Dc,n,k, and Bm are all known number.

Can anyone give me some suggestions on this problem? Thanks for reading!

I update the picture, and try to use AMPL language for my formulas.

enter image description here

    #AMPL model language

    #known numbers
    param L{c in 0..C, n in 0..N}; 
    param Tmax;
    param T{m in 0..M};
    param P{m in 0..M, s in 0..S, i in 0..I};
    param D{c in 0..C, n in 0..N, k in 0..K};

    #binary variable
    var X{c in 0..C, n in 0..N, m in 0..M, s in 0..S, i in 0..I} binary;

    #objective function
    maximize answer: sum{c in 0..C} r[c];

    #two subjections
    subject to s1{s in 0..S, i in 0..I}:  
    sum{c in 0..C}sum{n in 0..N}sum{m in 0..M} X[c,n,m,s,i] <= 1; 

    subject to s2{c in 0..C, n in 0..N}: 
    L[c,n]+Tmax >= sum{m in 0..M}sum{s in 0..S}sum{i in 0..I}T[m]*X[c,n,m,s,i] >= L[c,n]; 

    #where (I am not sure is it wright to write like this? Can somebody give me a hint?)
    V[c,n]=prod{k in 0..N}(prod{m in 0..M}prod{s in 0..S}prod{i in 0..I} P[m,s,i])^X[c,n,m,s,i])^D{c,n,k};
    r[c]=prod{n in 0..N}V[c,n]*(sum{m in 0..M}sum{s in 0..S}sum{i in 0..I}T[m]*X[c,n,m,s,i]);

The modification using logical constraint in order to remove the variable X from exponential:

    ### model_c.mod ###
    set C;
    set N;
    set M;
    set S;
    set I;
    set K;

    param Tmax;  #known numbers
    param L{c in C, n in N};
    param T{m in M};
    param P{m in M, s in S, i in I};
    param D{c in C, n in N, k in K};

    var X{c in C, n in N, m in M, s in S, i in I} binary;  #binary variable
    var Y{c in C, n in N};

    maximize answer: 
    (sum{c in C}(prod{n in N}(prod{k in K}Y[c,n]^D[c,n,k])*(sum{m in M}sum{s in S}sum{i in I}T[m]*X[c,n,m,s,i]))); #objective function

    subject to s1{c in C, n in N, m in M, s in S, i in I}: 
    Y[c,n]=Y[c,n]*((P[m,s,i]-1)*X[c,n,m,s,i]+1);

    subject to s2{s in S, i in I}: 
    sum{c in C}sum{n in N}sum{m in M} X[c,n,m,s,i] <= 1;

    subject to s3{c in C, n in N}: 
    L[c,n]+Tmax >= sum{m in M}sum{s in S}sum{i in I}T[m]*X[c,n,m,s,i] >= L[c,n];

    ### model_c.dat ###
    data;   
    set C:= count1, count2;
    set N:= frame1, frame2;
    set M:= M1, M2;
    set S:= sub1, sub2;
    set I:= i1, i2;
    set K:= k1, k2;

    param Tmax:=30;


    param L: frame1 frame2:=
    count1     2      3
    count2     4      5;


    param T:=  M1 10
       M2 20;


    param P:=
    [*,*,i1]: sub1 sub2 :=
        M1   0.9 0.8
        M2   0.7 0.6

    [*,*,i2]: sub1 sub2 :=
        M1   0.9 0.8
        M2   0.7 0.6;


    param D:=
    [*,*,k1]: frame1 frame2 :=
        count1 1 0
        count2 0 1 

    [*,*,k2]: frame1 frame2 :=
        count1 1 0
        count2 1 1;
Liam
  • 45
  • 1
  • 6

2 Answers2

1

I don't know, but maybe have a look at SCIP and or the opti toolbox. (or YALMIP). (Or Coin.)

In my experience, to build in Matlab is quite a hassle. Maybe it would be easier to create a .lp/.mps/.whatever output file and start a .exe from Matlab, which parses the file.

JaBe
  • 664
  • 1
  • 8
  • 27
1

it seems to me that in fact your model can be reformulated without exponential terms: the terms $P^x$ actually boils down to a logic constraint that equals to $1$ for $x=0$ or $P$ for $x=1$.

So my suggestion is to introduce some auxiliary variables $y$ to substitute the exponential terms and then set up the logic constraints.

The resulting model is still a huge MINLP: you need probably a solver like Couenne (free) or Baron (commercial).

UPDATE:

Actually it is even easier just say:

y_(m,s,i) = (P_(m,s,i) -1)x_(c,n,m,s,i) + 1

then you use y's in the huge product that defines V_(c,n). As you see, for x=0 you get 1, for x=1 you get P.

In this way you do not need any conditional constraints.

Anyway, next time I suggest you to post this kind of question on mathoverflow.

AndreaCassioli
  • 305
  • 2
  • 11
  • Hi, I am very appreciate for your suggestions. I update my post and using AMPL to model it at the first code part. At the second part I modified my model with logic constraints you mentioned(but I'm not sure is it the method you mentioned). Can you help me take a look for this modification? Thank you:) – Liam May 15 '14 at 09:05