Interprétation des résultats sous couenne

94 views
Skip to first unread message

moimeme diaby

unread,
Jun 9, 2019, 5:44:57 AM6/9/19
to AMPL Modeling Language
A tous et à toutes bonjour je vous remercie de l'intérêt que vous portez a mes questions 
et cette foi ci je viens en vers vous pour une explication concernant:
le modèle sous forme quadratique :
subject to contrainte5{k in K, (i,j) in A[k]}:
    X[k,i,j]*(T[k,j]+t[k,i,j]-T[k,i])<=M;
et le modèle en d'autre forme :
subject to contrainte5{k in K, (i,j) in A[k]}:
  X[k,i,j]=1 ==> t[k,i,j]<=T[k,j]-T[k,i];
dans le second cas si je compile avec cplex sa signale des erreurs au niveau des borne 
alors j'ai décidé de prendre la forme quadratique c'est à dire le premier et utiliser le solveur couenne et voici le message suivant et comme suis pas très bien en couenne je ne sais pas s'il ya des erreurs et à quel niveau sinon comment interpréter ces résultats 
Merci d'avance les aînés 
Cordialement !!!!
ampl: model graphicage.mod;
ampl: data graphicage.dat;
ampl: option solver couenne;
ampl: solve;
Couenne 0.5.6 -- an Open-Source solver for Mixed Integer Nonlinear Optimization
couenne:
ANALYSIS TEST: NLP0012I
              Num      Status      Obj             It       time                 Location
NLP0014I             1         OPT -192700       30 0.196
Couenne: new cutoff value -1.9270000000e+005 (0.428 seconds)
NLP0014I             2         OPT -192700        0 0
Loaded instance "C:\Users\DIABY\AppData\Local\Temp\at3840.nl"
Constraints:           19
Variables:             18 (18 integer)
Auxiliaries:           35 (35 integer)

Coin0506I Presolve 4 (-49) rows, 6 (-47) columns and 12 (-138) elements
Clp0006I 0  Obj -192700 Primal inf 13.999998 (2)
Clp0006I 2  Obj -192700
Clp0000I Optimal - objective value -192700
Clp0032I Optimal objective -192700 - 2 iterations time 0.032, Presolve 0.02
Clp0006I 0  Obj -192700 Primal inf 1.7373397 (1)
Clp0006I 1  Obj -192700
Clp0000I Optimal - objective value -192700
NLP Heuristic: time limit reached.
Clp0000I Optimal - objective value -192700
Optimality Based BT: 0 improved bounds
Probing: 0 improved bounds
NLP Heuristic: time limit reached.
Cbc0013I At root node, 0 cuts changed objective from -192700 to -192700 in 1 passes
Cbc0014I Cut generator 0 (Couenne convexifier cuts) - 0 row cuts average 0.0 elements, 3 column cuts (3 active)
Cbc0004I Integer solution of -192700 found after 0 iterations and 0 nodes (0.11 seconds)
Cbc0001I Search completed - best objective -192700, took 0 iterations and 0 nodes (0.11 seconds)
Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost

        "Finished"

Linearization cuts added at root node:         53
Linearization cuts added in total:             53  (separation time: 0s)
Total solve time:                           0.172s (0.172s in branch-and-bound)
Lower bound:                              -192700
Upper bound:                              -192700  (gap: 0.00%)
Branch-and-bound nodes:                         0

couenne: Optimal

Pietro Belotti

unread,
Jun 10, 2019, 5:28:51 AM6/10/19
to AMPL Modeling Language
This output doesn't show any error, Couenne solves the problem to optimality and the objective function value is -192700. This can be seen from the string "Finished" before the end summary (signaling that no time limit or no limit was met) and the "couenne: Optimal" at the very end.

Hope it helps.

moimeme diaby

unread,
Jun 12, 2019, 6:53:17 AM6/12/19
to AMPL Modeling Language
Bonjour et Merci vraiment ça aide vraiment 
et pour l'interprétation du résultats j'ai besoin de plus d'explication SVP

Pietro Belotti

unread,
Jun 13, 2019, 8:54:24 AM6/13/19
to AMPL Modeling Language
Well, the output says it all: the last lines show the total time it took to solve the problem (0.172s), the best lower bound on the objective function (lower bound: -192700) and the objective function value of the solution found (upper bound: -192700). This time the latter two coincide, but it may not happen all the time. There were no branch-and-bound node because the problem could be solved at the very beginning.

The lines beginning with Cbc are the output from the branch-and-bound solver, those beginning with Clp are those from the LP solver. The initial analysis also reveals that there are 19 constraints, 18 variables, all of which integer, and 35 extra variables added with reformulation (a necessary step in Couenne).

Hope this helps.

moimeme diaby

unread,
Jun 15, 2019, 4:21:11 PM6/15/19
to AMPL Modeling Language
Bonjour oui sa m'aide beaucoup et Merci !!!!

moimeme diaby

unread,
Jun 15, 2019, 4:41:57 PM6/15/19
to AMPL Modeling Language
Et voici mon nouveau problème 
ampl: reset;
ampl: model graphicage1.mod;
ampl: data graphicage1.dat;
ampl: option solver couenne;
ampl: solve;
presolve, constraint contrainte2['busc']:
        all variables eliminated, but lower bound = 1 > 0
presolve, constraint contrainte1[5]:
        all variables eliminated, but lower bound = 1 > 0
j'ai vraiment besoin de vos aides 
voici le modèle :
minimize costi_fissi:
 sum {k in K, (i,j) in A[k]: i!=j}q[k,i,j]*X[k,i,j]+
  sum {k in K, (i,j) in A[k]}lamda*I[k,i,j]*(T[k,j]-(T[k,i]+t[k,i,j]))*X[k,i,j];
 
subject to contrainte1{i in V}:
  sum{k in K, j in V:(i,j) in A[k]} X[k,i,j] >= 1;


subject to contrainte2{k in K}:
   sum{j in V :(o[k] ,j) in A[k]} X[k,o[k],j] = 1;
  
subject to contrainte3{k in K}:
  sum{i in V :(i,d[k]) in A[k]} X[k,i,d[k]] = 1;
  
subject to contrainte4{k in K, j in V1[k]}:
 sum{i in V1[k]:(i,j) in A[k]}X[k,i,j]-sum{i in N[k]:(j,i) in A[k]}X[k,j,i]=0;
 

  
subject to contrainte5{k in K, (i,j) in A[k]}:
  X[k,i,j]*((T[k,i]+t[k,i,j])-T[k,j])<=0;

 
subject to contrainte6{k in K, i in N[k]}:
 a[i]<= T[k,i]<=b[i];
et les données:
set K := busa busb busc ;

set N[busa] := 1 2 3 4 5 ;
set N[busb] := 1 2 3 4 5 ;
set N[busc] := 5 4 3 2 1 ;

set A[busa]:= (1,2) (1,3) (2,3) (2,4) (2,5) (3,2) (3,4) (4,2) (4,3) (4,5) ;
set A[busb]:= (1,2) (1,3) (2,3) (2,4) (2,5) (3,2) (3,4) (4,2) (4,3) (4,5) ;
set A[busc]:= (5,2) (5,4) (4,2) (4,3) (3,1) (3,2) (3,4) (2,1) (2,3) (2,4) ;
;
set V1[busa]:= 2 3 4;
set V1[busb]:= 2 3 4;
set V1[busc]:= 5 4 3;

set V:= 1  2  3  4  5 ;   
  
param t:=
[busa,*,*]:     1 2   3   4   5 :=
1            . 56   23   .   .
2             . .   45 70  68
3             . 75    .  50   .
4         .   25   35   .  25
5             . .   .   .   .
[busb,*,*]:     1 2   3   4   5 :=
1            . 36   43   .   .
2             . .   35 80  58
3             . 75    .  60   .
4         .   35   45   .  55
5             . .   .   .   .
[busc,*,*]:     1 2   3   4   5 :=
5            . 46    . 24   .
4             . 50   55   .   .
3            24 50    .  45   .
2        35    .   55  45   .  
1             . .   .   .   .
;
param q:=
[busa,*,*]:     1 2   3   4   5 :=
1            . 96   83   .   .
2             . .  435 170  168
3             . 735   .  500   .
4         .   75   95   .  245
5             . .   .   .   .
[busb,*,*]:     1 2     3     4     5 :=
1            . 136   143   .     .
2             . .    325 810  158
3             . 175    .     610   .
4         .   235   405     .   515
5             . .   .       .   .
[busc,*,*]:     1 2    3    4   5 :=
5            . 416    .  224   .
4             . 505  150    .     .
3           510 500    .  145     .
2        90    .   135  415     .    
1             . .   .     .   .
;
  param I:=
 [busa,*,*]:       1    2  3  4  5  :=  
 1                 .    1  1  .  . 
 2                 .    .  1  1  1
 3                 .    1  .  1  .
 4                 .    1  1  .  1     
 5                 .    .  .  .  .     
 [busb,*,*]:       1    2  3  4  5  :=  
 1                 .    1  1  .  . 
 2                 .    .  1  1  1
 3                 .    1  .  1  .
 4                 .    1  1  .  1     
 5                 .    .  .  .  .   
 [busc,*,*]:         1   2   3    4    5  :=
 5                   .   1   .    1    .
 4                   .   1   1    .    .     
 3                   1   1   .    1    .  
 2                   1   .   1    1    . 
 1                   .   .   .    .    .
 ;

#a is the lower bound of the time window of each customer (including depot)
param a:=
1 4
2 5
3 2 
4 10
5 7 
;
  
  param b:=   
1 20
2 15
3 12
4 14
5 20
  ;
   param d:=   
busa 5
busb 5
busc 1 
  ;
   param o:=   
busa 1
busb 1
busc 5 
  ;
  
 #param t_max:= 1000;
 param lamda:= 500; 
 
Je suis à l'écoute !!!!

Pietro Belotti

unread,
Jun 16, 2019, 1:22:21 PM6/16/19
to AMPL Modeling Language
This probably happens because there is an index k in K for which

{j in V :(o[k] ,j) in A[k]}

is empty or all of its variables were determined to be zero by the AMPL presolver, hence the left-hand side has no variables and the constraint reduces to 0 = 1, clearly infeasible.

moimeme diaby

unread,
Jun 17, 2019, 11:29:54 AM6/17/19
to AMPL Modeling Language
Bonjour sa m'aide 
mais est ce que vous pouvez me donner un exemple a travers les données que j'ai car j'arrive pas a me retrouver 

moimeme diaby

unread,
Jun 18, 2019, 5:21:51 PM6/18/19
to AMPL Modeling Language
Bonjour je voulai écrire cette contrainte:
t[k,i,j]+t[k,j,l]>= t[k,i,l] quelque soit {k in K, (i,j) in A[k] , (j,l) in A[k], (i,l) in A[k]};
et voici le message d'erreur 
graphicage1.mod, line 53 (offset 1335):
        Caution: 0-dimensional slice
context:  subject to contrainte7{k in K, (i,j) in A[k], (j,l) in A[k], (i,l) in  >>> A[k]} <<< :
j'aimerais savoir s'il ya une possibilité de fair sa ou si vous avez d'autres suggestion je suis intéressé  

AMPL Google Group

unread,
Jun 19, 2019, 12:11:39 PM6/19/19
to AMPL Modeling Language
In your constraint,

subject to contrainte7 {k in K, (i,j) in A[k], (j,l) in A[k], (i,l) in A[k]} : . . .

the terms in the indexing expression are processed from left to right. First (i,j) in A[k] gives values to i and j, and then (j,l) in A[k] gives a value to l. Thus when (i,l) in A[k] is reached, both i and l already have values, and this is the situation known as a "0-dimensional slice." For each k in K, (i,j) in A[k], (j,l) in A[k], one of two things will happen:
  • If (i,l) is in A[k], then a constraint contrainte7[k,i,j,l] will be generated.
  • if (i,l) is not in A[k], then no constraint will be generated.
AMPL displays a warning message in this situation, because the appearance of a 0-dimensional slice is often a sign that the constraint has not been written correctly.

--
Robert Fourer
am...@googlegroups.com
{#HS:874594512-46089#}
On Tue, Jun 18, 2019 at 9:22 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Bonjour je voulai écrire cette contrainte:
t[k,i,j]+t[k,j,l]>= t[k,i,l] quelque soit {k in K, (i,j) in A[k] , (j,l) in A[k], (i,l) in A[k]};
et voici le message d'erreur

graphicage1.mod, line 53 (offset 1335):
Caution: 0-dimensional slice
context: subject to contrainte7{k in K, (i,j) in A[k], (j,l) in A[k], (i,l) in >>> A[k]} <<< :
j'aimerais savoir s'il ya une possibilité de fair sa ou si vous avez d'autres suggestion je suis intéressé


a<= T[k,i]<=b;
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/3faa46e9-09d3-4a9d-b165-3385f109e464%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


moimeme diaby

unread,
Jun 22, 2019, 2:57:59 AM6/22/19
to AMPL Modeling Language
Bonjour et Merci bcps 
To unsubscribe from this group and stop receiving emails from it, send an email to am...@googlegroups.com.

moimeme diaby

unread,
Jun 22, 2019, 9:31:00 AM6/22/19
to AMPL Modeling Language
Et qu'elle la manière adéquate pour écrire donc la contrainte ?
C'est en quelque sorte l'inégalité triangulaire 
la contrainte en question ces la suivante :
t [k, i, j] + t [k, j, l]> = t [k, i, l] quelque soit {k dans K, (i, j) dans A [k], (j, l) dans A [k], (i, l) dans A [k]}; 
et si cela ne marche pas comment je peut l'écrire pour que sa marche ?? 

Le mercredi 19 juin 2019 16:11:39 UTC, AMPL Google Group a écrit :
To unsubscribe from this group and stop receiving emails from it, send an email to am...@googlegroups.com.

AMPL Google Group

unread,
Jun 24, 2019, 6:19:43 PM6/24/19
to AMPL Modeling Language
You could write

subject to Triangle {k in K, (i,j) in A[k], (j,l) in A[k]: (i,l) in A[k]}:
t[k, i, j] + t[k, j, l] >= t[k, i, l];

This will create the same constraints as if you wrote {k in K, (i,j) in A[k], (j,l) in A[k], (i,l) in A[k]}, but you won't get the "0-dimensional slice" warnings.

--
Robert Fourer
am...@googlegroups.com
{#HS:874594512-46089#}
On Sat, Jun 22, 2019 at 1:31 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Et qu'elle la manière adéquate pour écrire donc la contrainte ?
C'est en quelque sorte l'inégalité triangulaire
la contrainte en question ces la suivante :

> t [k, i, j] + t [k, j, l]> = t [k, i, l] quelque soit {k dans K, (i, j)
> dans A [k], (j, l) dans A [k], (i, l) dans A [k]};

et si cela ne marche pas comment je peut l'écrire pour que sa marche ??


On Sat, Jun 22, 2019 at 6:58 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Bonjour et Merci bcps


On Wed, Jun 19, 2019 at 4:11 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
In your constraint,

subject to contrainte7 {k in K, (i,j) in A[k], (j,l) in A[k], (i,l) in A[k]} : . . .

the terms in the indexing expression are processed from left to right. First (i,j) in A[k] gives values to i and j, and then (j,l) in A[k] gives a value to l. Thus when (i,l) in A[k] is reached, both i and l already have values, and this is the situation known as a "0-dimensional slice." For each k in K, (i,j) in A[k], (j,l) in A[k], one of two things will happen:
  • If (i,l) is in A[k], then a constraint contrainte7[k,i,j,l] will be generated.
  • if (i,l) is not in A[k], then no constraint will be generated.
AMPL displays a warning message in this situation, because the appearance of a 0-dimensional slice is often a sign that the constraint has not been written correctly.

--
Robert Fourer
am...@googlegroups.com

moimeme diaby

unread,
Jun 28, 2019, 3:44:00 PM6/28/19
to AMPL Modeling Language
Bonjour tout le monde et Merci pour vos précieux aide 
alors dans mon modèle j'ai défini un ensemble B comme suivante:set B{k in K} within {(i, j) in A [k]: i <> o [k] and j <> d [k]};
le o[k] et le d[k] sont les dépôts donc B est l'ensemble des inter arcs et voici le résultat : 
X [busa,*,*]
:   2   3   4   5    :=
1   1   0   .   .
2   .   1   1   0
3   .   .   1   .
4   .   .   .   1

 [busb,*,*]
:   2   3   4   5    :=
1   1   0   .   .
2   .   1   1   0
3   .   .   1   .
4   .   .   .   1

 [busc,*,*]
:   1   2   3   4    :=
2   1   .   .   .
3   0   1   .   .
4   .   1   1   .
5   .   0   .   1
;
Si vous regardez bien le programme considère toutes les inter acrs alors qu'il doit prendre les arcs a coûts min 
exemple le busa voici ce qu'il fait regarder le document en PJ                                    Dans ce fichier il a considéré les arcs (2,3) et (2,4) alors qu'il doit prendre un seul des deux de même que les autres bus donc qu'est ce que je doit faire pour que le programme prend sa en compte ?          
2.pdf

moimeme diaby

unread,
Jul 1, 2019, 8:04:36 AM7/1/19
to AMPL Modeling Language
Bonjour tout le Monde Svp j'attend vos réactions concernant mon problème 

AMPL Google Group

unread,
Jul 2, 2019, 6:29:39 AM7/2/19
to AMPL Modeling Language
Probably you are not going to get help here with this question. This is an English language forum, and you have written the question in French; and when it is translated into English using, say, Google Translate, the question is not clear. Also, you seem to be asking why the model does not give the results for variable X that you expect; but since you are the one who knows your model best, this is a question that you need to answer for yourself by studying the model and the solution.

--
Robert Fourer
am...@googlegroups.com
{#HS:874594512-46089#}
On Mon, Jul 1, 2019 at 12:05 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Bonjour tout le Monde Svp j'attend vos réactions concernant mon problème


moimeme diaby

unread,
Jul 5, 2019, 8:25:25 AM7/5/19
to AMPL Modeling Language
Bonjour les anciens 
je voulais s'avoir s'il y'a une fonction prédéfinie pour déterminer le plus court chemin dans un graphe ?
si oui qu'elle est cette fonction et est ce que quelqu'un peut m'aider et me donner un exemple.
j'ai un graphe et je veut obtenir le plus court chemin 
Merci d'avance et merci de vos brillant contribution pour mes problèmes 

AMPL Google Group

unread,
Jul 7, 2019, 1:54:07 PM7/7/19
to AMPL Modeling Language
AMPL does not have a predefined function that determines the shortest path in a graph. To find a shortest path using AMPL you would need to define a shortest path model, as described for example in the section on Shortest path models in the AMPL book, which begins at the bottom of https://ampl.com/BOOK/CHAPTERS/18-network.pdf#page=11.

--
Robert Fourer
am...@googlegroups.com
{#HS:874594512-46089#}
On Fri, Jul 5, 2019 at 12:25 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Bonjour les anciens
je voulais s'avoir s'il y'a une fonction prédéfinie pour déterminer le plus court chemin dans un graphe ?
si oui qu'elle est cette fonction et est ce que quelqu'un peut m'aider et me donner un exemple.
j'ai un graphe et je veut obtenir le plus court chemin
Merci d'avance et merci de vos brillant contribution pour mes problèmes


On Tue, Jul 2, 2019 at 10:29 AM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Probably you are not going to get help here with this question. This is an English language forum, and you have written the question in French; and when it is translated into English using, say, Google Translate, the question is not clear. Also, you seem to be asking why the model does not give the results for variable X that you expect; but since you are the one who knows your model best, this is a question that you need to answer for yourself by studying the model and the solution.

--
Robert Fourer
am...@googlegroups.com

Reply all
Reply to author
Forward
0 new messages