# [AMPL 25023] Result "optimal solution; objective 0 0 simplex iterations"

Hello, I’ve done the following modeling and I’m getting a solution with 0 iterations. Is this due to some restriction?

``````set F;
set H;
set R;

param p {i in F, j in H};
param u {i in F};
param a {j in H};
param d {j in H, k in R};
param s {i in F, j in H, k in R};

var x {i in F, j in H};
var y {i in F, j in H, k in R};

minimize TC:
sum {i in F, j in H} p[i,j] * x[i,j] + sum {i in F, j in H, k in R} s[i,j,k] * y[i,j,k];

subject to capacity {i in F}:
sum {j in H} a[j] * x[i,j] <= u[i];

subject to demands {j in H, k in R}:
sum {i in F} y[i,j,k] <= d[j,k];

subject to balance {i in F, j in H}:
sum {k in R} y[i,j,k] <= x[i,j];

subject to limitY {i in F, j in H, k in R}:
0 <= y[i,j,k];

subject to limitX {i in F, j in H}:
0 <= x[i,j];
``````

Here’s my data archive

``````set F := 1 2 3;
set H := 1 2 3 4 5 6 7;
set R := 1 2 3 4 5 6 7 8 9 10;

param p (tr):
1 2 3 :=
1 30 30 10
2 50 75 40
3 10 10 18
4 65 22 25
5 95 85 50
6 50 20 10
7 25 32 30;

param u := 1 20000 2 15000 3 30000 ;

param a := 1 2
2 5
3 8
4 2
5 5
6 3
7 7 ;

param d (tr): 1 2 3 4 5 6 7 :=
1 50 79 53 42 85 52 50
2 54 80 76 50 50 85 75
3 60 66 77 66 60 70 80
4 46 57 80 74 60 86 64
5 76 47 56 87 70 69 92
6 96 60 60 65 95 73 83
7 46 87 70 84 80 86 81
8 42 47 86 77 70 99 71
9 34 20 76 50 80 71 60
10 47 46 57 60 60 82 69;

param s :=
[*,*,1]: 1 2 3 4 5 6 7 :=
1 30 10 8 10 11 71 6
2 22 7 10 7 21 82 13
3 19 11 12 10 25 83 15
[*,*,2]: 1 2 3 4 5 6 7 :=
1 39 14 11 14 16 82 8
2 27 9 12 9 26 95 17
3 24 14 17 13 28 99 20
[*,*,3]: 1 2 3 4 5 6 7 :=
1 41 15 12 16 17 86 8
2 29 9 13 9 28 99 18
3 26 14 17 13 31 104 20
[*,*,4]: 1 2 3 4 5 6 7 :=
1 27 9 12 9 26 95 17
2 39 14 11 14 16 82 8
3 24 14 17 13 28 99 20
[*,*,5]: 1 2 3 4 5 6 7 :=
1 39 14 11 14 16 82 8
2 27 9 12 9 26 95 17
3 24 14 17 13 28 99 20
[*,*,6]: 1 2 3 4 5 6 7 :=
1 14 10 16 10 30 25 35
2 10 16 17 16 27 30 80
3 16 27 30 14 10 16 54
[*,*,7]: 1 2 3 4 5 6 7 :=
1 20 19 23 32 15 22 50
2 14 10 16 10 30 25 35
3 10 16 17 16 27 30 80
[*,*,8]: 1 2 3 4 5 6 7 :=
1 39 14 11 14 16 82 8
2 27 20 12 9 26 95 17
3 24 14 17 13 28 99 20
[*,*,9]: 1 2 3 4 5 6 7 :=
1 39 14 11 14 16 82 8
2 27 9 12 9 26 95 17
3 24 14 17 13 28 99 20
[*,*,10]: 1 2 3 4 5 6 7 :=
1 10 16 17 16 27 30 80
2 16 27 30 14 10 16 54
3 16 17 16 27 30 49 32;``````

“0 iterations” means that the solve did finish successfully, but it was able to find an optimal solution without doing any iterations of the chosen algorithm.

I confirmed this with the Gurobi solver, and after solving, the AMPL command `display` `x,` `y;` showed that the optimal values of all the variables were zero! In fact it is easy to see that 0 is the smallest possible value of the objective function; and also when all of the variables are zero, the constraints are all satisfied. For a trivial optimum like this, it is not so surprising that no iterations are needed to find the solution.

When an unexpected solution like this appears, it is usually due to a simple error in one of the constraints.