we are solving the if-else condition problem with introducing binary variables but it creates another problem as invalid quadratic form(s): not a square, which occurs by multiplication of binary and continuous variables how can I solve this problem?
When you introduce binary variables for logical constraint modeling, you should not multiply binary variables with continuous variables. The whole idea is not to do that.
See the first part of section 2.8 of https://www.fico.com/en/resource-download-file/3217 to see how to rewrite the product of a binary with a continuous variable.
Hello.
The mentioned page was not founded (error 404). I used big-M method to handle multiplication of binary (decision) variables ({q_i^n}) by continuous variables ({W_i^n}) where i=1,2,3 is index of users and n=1,2 is index of subchannels. As i expect that at least one subchannel is assigned to each user, the result is like q_1^1=1, q_1^2=1e-8, q_2^1=0.01, q_2^2=1e-8, q_3^1=1e-8, q_3^2=0.02.
I mean for example about user 2, i expect q_2^1 be equal to 1 or almost 1 such that they are able to meet the required constraints (QoS constraints). i must say that i used transform the discrete binary variables to continuous and forced them by using a penalty-based approche with different penalty factors (small values to large values). Also, i added four straightforward constraints related to big-M. Can you guide me? Let me know in case of more information.
Regards
Updated link is https://www.fico.com/fico-xpress-optimization/docs/latest/mipform/dhtml/chap2s1.html?scroll=ssecprodval . That shows how to do “Big M”, with the smallest possible M, which is the best M to use.
I recommend not using a penalty approach. Just use Big M as in the link.
Thanks a lot. I used it.
I used big-M adapted with continuous square matrix variable without penalty approach, but it does not work and none of q_i^n tends to 1. Here, you can see big-M necessary constraints
where Pmax is chosen as M according to the communication papers. This is the results of all q (i=1,…,5, n=1,2) found by cvx
As it is shown, there is no 0 or 1. If I add the cost function of q to the objective function with a penalty factor e.g. lambda=100, the results change as follows
As you see, there is only one exact 1 and four 0(…e-9) and I think that others should be 1 but the problem cant force them.
When you use Big M, you need to declare the appropriate variables as binary, which you apparently did not do. Your attempted use of penalty term did not accomplish what you wanted, and I have no a priori reason to think that it should.
If you think that use of binary variables will make the problem too computationally difficult to solve within a timeframe you like, that might be a consequence of your problem being difficult to solve.
Also note that there is no solver under CVX which can handle an SDP (which per C8, C9, C10, C11) you have, which has any binary or integer variables (CVX will accept the problem, but none of the solvers under CVX can handle it). You can use YALMIP with either YALMIP’s BNB + SDP solver (Mosek, SeDuMi, SDPT3, etc.) or perhaps YALMIP’s CUTSDP.
I use solver Mosek. Also, because constraint
is not acceptable in cvx, I use these two constraints instead of C4
Moreover, I transform C4b to the objective function with a penalty factor to penalize q in case of not being 0 and 1. Of course, I use a first order Taylor expansion for C4b as well.
If it works well for your purposes, great. Otherwise, I suggest use of YALMIP’s MISDP capability with BNB or CUTSDP, per my previous post. If Mosek ever produced a version having MISDP capability (which doesn’t seem too likely), I think you would be able to declare binary variables in CVX and solve the MISDP under CVX. But YALMIP lets you do that now.