hi! i am very new to Gams
how can i create a random input network in gams
i mean arc costs will be randomly generated and also number of node
and arcs will be randomly generated
do you have any examples for generating random input
thx
\
hi! i am very new to Gams
how can i create a random input network in gams
i mean arc costs will be randomly generated and also number of node
and arcs will be randomly generated
do you have any examples for generating random input
thx
\
Dear Muhtelif,
I really would like to help, but I don’t really understand what your
question is.
If you want to know how to generate random numbers in GAMS, I can tell
you how I do it, normally. Since I often have to work with randomly
generated instances that follow a certain distribution and are
dependant on a few other parameters, I use Excel to generate my random
numbers and import them using GDX. The nice thing is, if you set
Excel just right, it generates a new number each time GAMS accesses
the file, resulting in random numbers for each run I perform in GAMS.
Maybe that helped, if not, let me (or us) know.
Regards
Christian
\
Hi,
I got some contribution for this question. Please find the GAMS model
below. You do not want a generator to select the number of nodes
randomly. You want this at input. Also the density of the arcs in a
network is usually supplied.
Hope this helps,
Michael Bussieck - GAMSWorld Coordinator
here are a few hints.
1 check that a random (undirected) network is connected
the arcs in the upper/lower triangle of the adjacency
matrix cannot have an empty row/column.
set n nodes / n1*n10 /; alias (n,nn);
set a(n,n) adjacancy matrix (symetric);
parameter arcs(n) total arcs entering or leaving node
cnt(n) row or col count;
a(n,n+UniformInt(1,card(n)-ord(n)))$(ord(n) wrote:
hi! i am very new to Gams
how can i create a random input network in gams
i mean arc costs will be randomly generated and also number of node
and arcs will be randomly generated
do you have any examples for generating random inputthx
\