title: GLPK: no primal feasible solution
body: <p>i m trying to solve a problem in GLPK, but it gives me this msg "problem has no primal feasible solution". Below you ll find the program. the constraint that gives me the error is the "constraint 6", but i don t know how can i fix it. tnx for ur help guys</p>
  
  <pre><code>param n, integer ; # nbr noeuds
  param l, integer ; # Number of periods
  param m, integer ; # nbr vehicle
  set N := 0..n ; # set of nodes (plans &amp; customers)
  set Nc := 1..n ;
  set T := 0..l ; # set of periods
  set K := 1..m ; # vehicles
  set A := {i in N, j in N : i!=j}; #Set of Arcs
  # paramètres 
  param u ; # unit produc. cost
  param f ; # fixed produc. cost
  param h{i in N},integer, &gt;=0 ; # Holding cost
  param c {i in N, j in N},integer, &gt;=0 ; # Transportation cost
  param C ; # Production capacity
  param Q ; # Vehicle capacity
  param L {i in N},integer, &gt;=0 ; #Maximum or target inventory level at node i
  param I0 {i in N},integer, &gt;=0 ; # initial inventory at node i period 0
  param d{i in N, t in T},integer, &gt;=0  ; # demand
  param M{t in T} := min( C, sum {j in T, i in Nc:j&gt;=t } d[i,j] );
  param Mx{i in Nc, t in T} := min( L[i], Q, sum {j in T:j&gt;=t } d[i,j] );
  # variables 
  var p{t in T}, &gt;=0, integer ; # production qty 
  var q{i in N, t in T}, &gt;=0, integer ; # qty delivered
  var y{t in T}, binary ;# Setup for period t (1 if there is production at 
  var x{i in N, j in N, t in T}, binary; # 1 if a vehicle travels directly from node i to j, 0 otherwise
  var I{i in N, t in T}, integer, &gt;=0 ;   # Inventory at node i, period t
  var z0{t in T}, integer, &gt;=0; # the number of vehicles leaving the plant in period t
  var z {i in Nc, t in T}, binary;  # 1 if customer i is visited in t, 0 otherwise
  var w {i in N, t in T}, integer, &gt;=0  ;#load of vehicle before making a delivery
  # fonction objectif: mimiser les coûts
  minimize cost: sum{t in T:t&gt;0} ( u*p[t]+ f*y[t] +(sum{i in N} h[i]*I[i,t] )+ 
  (sum{ (i,j) in A} c[i,j]*x[i,j,t] )) ;
  
  
  s.t. RInit{i in N}       : I0[i] = 0 ;
  # Constraint (2)
  s.t. R1{t in T:t&gt;0}:I[0, t-1]+p[t]=sum{i in Nc}q[i,t]+I[0,t];
  # Constraint (3)
  s.t. R2{i in Nc, t in T:t&gt;0} : I[i,t-1] + q[i,t] = d[i,t] + I[i,t] ;
  # Constraint (4)
  s.t. R3{t in T:t&gt;0} : p[t] &lt;= M[t]*y[t] ;
  # Constraint (5)
  s.t.R4{t in T:t&gt;0} : I[0,t] &lt;= L[0];
  # Constraint (6)
  s.t. R5{i in Nc, t in T:t&gt;0} : I[i,t-1]+q[i,t] &lt;= L[i];
  # Constraint (7)
  s.t. R6{i in Nc, t in T:t&gt;0} : q[i,t] &lt;= Mx[i,t]*z[i,t];
  # Constraint (8)
  s.t. R7{ i in Nc ,t in T:t&gt;0}: (sum{j in N} x[j,i,t])=z[i,t];
  # Constraint (9)
  s.t. R8{i in N, t in T: t&gt;0 and i&gt;0} :sum{j in N}x[j,i,t]+sum{j in N} x[i,j,t]= 2*z[i,t];
  # Constraint (10)
  s.t. R9{t in T: t&gt;0}: z0[t]&lt;= m;
  #Constraint (11)
  s.t. R10{ t in T,(i,j) in A: t&gt;0 and i&gt;0}: w[i,t]-w[j,t]&gt;=q[i,t]-Mx[i,t]*(1-x[i,j,t]);
  #Constraint (12)
  s.t. R11{i in Nc, t in T: t&gt;0}:0 &lt;= w[i,t] ;
  s.t. R12{i in Nc, t in T: t&gt;0}: w[i,t] &lt;= Q*z[i,t];
  #Constraint (13)
  s.t. R13{i in N, t in T:t&gt;0}: p[t] &gt;=0;
  s.t. R14{i in N, t in T:t&gt;0} : I[i,t] &gt;=0; 
  s.t. R15{i in N, t in T:t&gt;0} : q[i,t] &gt;=0;
  solve ;
  printf "\n\nTotal cost:%f\n", cost ;
  display Mx ;
  display M ;
  data;
  param n := 3;
  param l := 6 ;
  param m := 1 ;
  param u := 1 ;
  param f := 10 ;
  param C := 4;
  param Q := 5;
  param d : 0 1 2 3 4 5 6 :=
            0  0 0 0 0 0 0 0
            1  0 5 6 7 8 9 10
            2  0 6 7 8 9 10 11 
            3  0 6 7 8 9 10 12 ;
  param c : 0 1 2 3  :=
     0  0 0 0 0 
     1  5 6 7 8 
     2  6 7 8 9 
     3  6 7 8 9  ;
  param h  :=
     0  4
     1  5
     2  6
     3  6  ;
  param I0  :=
     0  0
     1  0
     2  0
     3  0  ;
  param L  :=
     0  0
     1  1
     2  2
     3  3  ;
  end ;
  </code></pre>