I'm have a binary integer programming problem and want to solve it with bintprog
.
A = [1 0 1 0; 0 1 1 0; 1 1 1 1; 0 0 1 1];
f=[1 1 1 1];
b=[1 1 1 1];
[x,xfval,exitflag,output]=bintprog(f,-A,-b);
The solution bintprog
gave me is x={3}
, but I would like the solution to be x={1,2}
which mean 4 is reachable if 1 and 2 (which connected to 3) are both selected. What can I do to get the result that I wanted?
EDIT: Node 3 act like a switch that can only be enabled if at least 2 nodes that connected to it are active. When that happens, the last node can be reached. For e.g, if 1,2 are active, 4 can be reached. Same can also be said if 1,4 are active, 2 can be reached. 3 obviously shouldn't be the solution.