I am trying to do some network programming around optimization. Here is a reduced sample:
f = Minimize[{q,
a + b <= q
&& c + d <= q // These represent edges in a network
&& c <= q
&& a + b + c + d <= q
&& a + b + d <= q
&& a + b >= 1 // other restraints
&& c + d >= 1
&& 0 <= a <= 1
&& 0 <= b <= 1
&& 0 <= c <= 1
&& 0 <= d <= 1
&& 0 <= q <= 4}, { q, a, b, c, d}]
While I have answers and know what I'm doing. My question is I wish to speed things up. I wish to change this code from that to this:
f = Minimize[{q,
a + b <= iq
&& c + d <= iq
&& c <= iq
&& a + b + c + d <= iq
&& a + b + d <= iq
&& a + b >= 1
&& c + d >= 1
&& 0 <= a <= 1
&& 0 <= b <= 1
&& 0 <= c <= 1
&& 0 <= d <= 1
&& 0 <= q <= (i*4)}, { q, a, b, c, d}]
where "i" will be an incrementing number.
I've been reading Stephen Wolfram's Mathematica second edition (1991?) book which I loaned from my university library, whilst it's been a major help in guiding me this far. It is a little outdated and searching the internet has provided little help either. I'm working with Mathematica 8.0.0.0.
I'm taking a guess that each line with i*q cannot have the same i as this would prove difficult in linear optimization(?)... Please correct me if I'm wrong
I'm a beginner to Mathematica and I'm finding the language to be much more easier to understand that Matlab. I have the answers I want or know how to get the remaining answers. I just want to speed things up.
Many thanks in helping me become more efficient in this program
EDIT::
Hi, thanks for the feedback.
@David: This isn't the full constraint table. I've reduced it down so some are missing. I apologise for missing constraints.
@Jinxed: Basically I'm trying to figure out q for incrementing values of i. So in a loop:
a + b <= iq
&& c + d <= iq
&& c <= iq
&& a + b + c + d <= iq
&& a + b + d <= iq
becomes =>
a + b <= 2q
&& c + d <= 2iq
&& c <= 2iq
&& a + b + c + d <= 1q
&& a + b + d <= 2iq
Then =>
a + b <= 3q
&& c + d <= 3q
&& c <= 3q
&& a + b + c + d <= 1q
&& a + b + d <= 3q
up until "i" reaches a top. I'm trying to observe what happens when I bottleneck particular edges in a network and the effects of it.
As I've said before, I'm a total beginner on this program so please forgive me if there are obvious fallings in places.

iqlooks like a typo: Did you meani*q? What is it exactly, that you want to speed up? If it is execution speed, look at Bill's comment. If it is your speed in working with Mathematica , look at Sjoerd's. – Jinxed Apr 07 '15 at 17:41FindMinimuminstead ofMinimize.Minimizetries to solve the problem symbolically, which is in general more expensive.FindMinimumuses local optimization, which is usually fastest, and for an LP is guaranteed to find the global minimum. – Niki Estner Apr 07 '15 at 19:11//does not start a comment in Mathematica code! – Niki Estner Apr 07 '15 at 19:12