[AMPL 15273] minimum value!!!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 15273] minimum value!!!

sahebeh.azar
Hi all

How I can get the number of each rows?

As example:

distance[i,j]:=
   i=                  1            2           3              4           5

  j =   5             5           25           20            15          30
        8             20          10          15             15          20
        7             10          15            5             10          20
       10             10          20          15            25           5
        4              15         5            10              5          10

param min_dis {i in V} = min {j in S}  distance[i,j];

1:=5   -------> 5 belong to j=5
2:=5   -------> 5 belong to j=4
3:=5   -------> 5 belong to j=7
4:=5   -------> 5 belong to j=4
5:=5  -------> 5 belong to j=10

I want to get the number of j in all columns when we have a minimum value!!

WBR

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: [AMPL 15282] minimum value!!!

Robert Fourer-2
Please look at these answers to similar questions in this group:

https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ
https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ

Bob Fourer
[hidden email]

=======

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Saturday, December 2, 2017 10:18 AM
To: AMPL Modeling Language
Subject: [AMPL 15273] minimum value!!!

How I can get the number of each rows?

As example:

distance[i,j]:=
   i=                  1            2           3              4           5

  j =   5             5           25           20            15          30
        8             20          10          15             15          20
        7             10          15            5             10          20
       10             10          20          15            25           5
        4              15         5            10              5          10

param min_dis {i in V} = min {j in S}  distance[i,j];

1:=5   -------> 5 belong to j=5
2:=5   -------> 5 belong to j=4
3:=5   -------> 5 belong to j=7
4:=5   -------> 5 belong to j=4
5:=5  -------> 5 belong to j=10

I want to get the number of j in all columns when we have a minimum value!!


--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 15321] minimum value!!!

sahebeh.azar
That was me! thank you again
could you help me with this new problem please?it is so important for me
As example:

param s:=2;
set w {i in v};

set r0 {i in v}; --------> r0[1]:=5
                               r0[2]:=10,4

set r1 {i in v}; --------> r1[1]:=1
                               r1[2]:=2

if (card(r0)!=s) then let w[i]:={ {r0[i]} union {r1[i]} union {w[i] } --------------> this code is definitely wrong but how can I get to this answer?? w[1]:={5,1} , w[2]:={10,4}
                                                                                                            

On Sunday, December 3, 2017 at 9:37:14 PM UTC+3:30, Robert Fourer wrote:
Please look at these answers to similar questions in this group:

<a href="https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ&#39;;return true;">https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ
<a href="https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ&#39;;return true;">https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ

Bob Fourer
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="9BzBIEj7AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@...

=======

From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="9BzBIEj7AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@... [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="9BzBIEj7AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@...] On Behalf Of <a href="javascript:" target="_blank" gdf-obfuscated-mailto="9BzBIEj7AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">sahebe...@...
Sent: Saturday, December 2, 2017 10:18 AM
To: AMPL Modeling Language
Subject: [AMPL 15273] minimum value!!!

How I can get the number of each rows?

As example:

distance[i,j]:=
   i=                  1            2           3              4           5

  j =   5             5           25           20            15          30
        8             20          10          15             15          20
        7             10          15            5             10          20
       10             10          20          15            25           5
        4              15         5            10              5          10

param min_dis {i in V} = min {j in S}  distance[i,j];

1:=5   -------> 5 belong to j=5
2:=5   -------> 5 belong to j=4
3:=5   -------> 5 belong to j=7
4:=5   -------> 5 belong to j=4
5:=5  -------> 5 belong to j=10

I want to get the number of j in all columns when we have a minimum value!!


--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 15335] minimum value!!!

ptiwari
It's not quite clear what are you trying to do from your example. Are you trying to take union of r0 and r1. You could do like let {i in v} w[i] := r0[i] union r1[i];

On Friday, December 8, 2017 at 8:21:35 AM UTC-8, [hidden email] wrote:
That was me! thank you again
could you help me with this new problem please?it is so important for me
As example:

param s:=2;
set w {i in v};

set r0 {i in v}; --------> r0[1]:=5
                               r0[2]:=10,4

set r1 {i in v}; --------> r1[1]:=1
                               r1[2]:=2

if (card(r0)!=s) then let w[i]:={ {r0[i]} union {r1[i]} union {w[i] } --------------> this code is definitely wrong but how can I get to this answer?? w[1]:={5,1} , w[2]:={10,4}
                                                                                                            

On Sunday, December 3, 2017 at 9:37:14 PM UTC+3:30, Robert Fourer wrote:
Please look at these answers to similar questions in this group:

<a href="https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ&#39;;return true;">https://groups.google.com/d/msg/ampl/I8REEQjpBVg/UzUJ3y2rAQAJ
<a href="https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ&#39;;return true;">https://groups.google.com/d/msg/ampl/OAYl0go7a5Y/-LWFTdqyBwAJ

Bob Fourer
[hidden email]

=======

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Saturday, December 2, 2017 10:18 AM
To: AMPL Modeling Language
Subject: [AMPL 15273] minimum value!!!

How I can get the number of each rows?

As example:

distance[i,j]:=
   i=                  1            2           3              4           5

  j =   5             5           25           20            15          30
        8             20          10          15             15          20
        7             10          15            5             10          20
       10             10          20          15            25           5
        4              15         5            10              5          10

param min_dis {i in V} = min {j in S}  distance[i,j];

1:=5   -------> 5 belong to j=5
2:=5   -------> 5 belong to j=4
3:=5   -------> 5 belong to j=7
4:=5   -------> 5 belong to j=4
5:=5  -------> 5 belong to j=10

I want to get the number of j in all columns when we have a minimum value!!


--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.