Thanks for this post. I am dealing with a problem that I have another Then I run a small code with matlab and cplex12.5.1, the result shows that only one variable is triggered, never two or more x variables at the same time, which means that However, what I expect is that when I change the input (let's say the weight can be increased), the number of decision variables x should be increased correspondingly like Many thanks.
I wrote a concise program that describes what I want to do as in the file attached. Now, the problem is that the result of decision variables x always keeps TWO "1" variables whatever I change the traffic demands. This means that when the traffic demands change, the decision variables x might change the position, like x[0 1 1 0 0 0 0 0] to x[1 0 0 0 1 0 0 0], but it does not change the number of variables. What I would like to expect here is that when I change the traffic demands T, for instance, T is increased, x should be more "1", and when T is decreased to a small traffic amount, x should be ONE "1". Can you figure out any bugs here? Many thanks.
asked
ttungl |

There is insufficient information given to say anything definitive. If you can find a solution with more than one nonzero component that is provably feasible and provably better in objective terms than what you get, then you have a bug in your code.

Thanks Dr. Paul Rubin. I wrote a program that can be able to give the result yet not correctly. The result shows that when adding a small amount of weight, it gives x[1,0,0,1,0,0,0,0] but it is expected as only one "1" decision variable is enough. When increasing a larger amount of weight, decision variables x still keep TWO triggered decision variables but in different order, like x[0,1,0,0,0,0,1,0]. It's wrong. That means when increasing a bigger amount of weight, the decision variables should be increased, and this can be done by CPLEX solver.How can I post my code for discussing?

just edit your post, and then you can copy your code and select code formatting in selection bar.

thanks zBirdy, I already updated in this post. Since the code is long, I uploaded it through the megaupload for convenience.