help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] cross two or more set


From: Bembi Prima
Subject: [Help-glpk] cross two or more set
Date: Wed, 17 Jul 2013 14:51:33 +0700

Hi All,

I am new in using glpk and need some help.
In my model I have mutliple sets,

set A;
set B;
set C;
set AB dimen 2;
set ABC dimen 3;

data;
set A := A1 A2 A3 A4 A5;
set B := B1 B2 B3;
set C := C1 C2;

set AB : B1 B2 B3 :=
A1 + - +
A2 - - -
A3 + + -
A4 - - +
A5 + - -

What I want to make is cross product set AB with C, is that possible without using +/- matrix and/or slice? Because the final set is exceptionally big one.
So in the end I want to have is
set ABC := {(A1,B1,C1),(A1,B3,C1),(A3,B1,C1),(A3,B2,C1),(A4,B3,C1),(A5,B1,C1), (A1,B1,C2),(A1,B3,C2),(A3,B1,C2),(A3,B2,C2),(A4,B3,C2),(A5,B1,C2)};

I have used within and cross, but it still fail. the error says that variable ABC cannot be subscripted.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]