[AMPL 3532] adding elements to a set

946 views
Skip to first unread message

Eser

unread,
May 21, 2010, 8:18:13 AM5/21/10
to AMPL Modeling Language
Hi,

I am trying to solve a column generation based network problem.
After solving a set of subproblems, I find new paths which I am
supposed to add to a set including the already generated paths.
I start running the program with a basic feasible solution, so the
problem looks like as follows:

Ex:

set Paths_BFS = Path1,Path2,......,PathK
Say that after solving a set of subproblems, I find a set M including
n new paths.
What I want is to be able to get a union of set Paths_BFS and set M.

I tried to use "redeclare" to solve this problem, but I am not allowed
to write

redeclare set Paths_BFS = Paths_BFS union M;

Thanks for helping
Eser

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to am...@googlegroups.com.
To unsubscribe from this group, send email to ampl+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ampl?hl=en.

Paul

unread,
May 21, 2010, 11:34:20 AM5/21/10
to AMPL Modeling Language

On May 21, 8:18 am, Eser <eseresir...@gmail.com> wrote:
> What I want is to be able to get a union of set Paths_BFS and set M.
>
> I tried to use "redeclare" to solve this problem, but I am not allowed
> to write
>
> redeclare set Paths_BFS = Paths_BFS union M;
>

What about the following?

let Paths_BFS := Paths_BFS union M;

/Paul

Eser

unread,
May 21, 2010, 11:47:05 AM5/21/10
to AMPL Modeling Language
let Paths_BFS := Paths_BFS union M;

This has not worked for me, either. I recieved the following error
message:

Paths_BFS has an = assignment in the model;

Paul

unread,
May 21, 2010, 4:29:37 PM5/21/10
to AMPL Modeling Language
Change

set Paths_BFS = ...;

to

set Paths_BFS;
let Paths_BFS := ...; # initial assignment

I think that should work.

/Paul

Allexandre Fortes S. Reis

unread,
Oct 19, 2014, 1:47:08 PM10/19/14
to am...@googlegroups.com
Hello,

I'm also working on Column Generation problem. To solve this problem it is easier than you imagine. You just have to create your set Paths := {1..n} and then, to add a new position you havr to only make the n bigger, I just increase one unit im its size (n+1). The set paths will be automatically increased too.

Reply all
Reply to author
Forward
0 new messages