Re: Gmpl How can I do this?

Michael Hennebry <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <[email protected]>
On Thu, 26 Mar 2020, siirto1 wrote:

> I am trying to do some simple gmpl model but as a complete beginner I noticed I cannot do it.

THe issue appears not to be representing a model in GMPL,
but getting a model to represent.

>    col1 col2 col3
> row1  x
> row2  x    x
> row3  x    x    x
>
> Assign numbers 1..6 to the x cells so that every number has different row and col than the previous number.

I suggest 2 2D arrays of binary values.
xincol[x, c] == 1 iff x in column c.
xinrow[x, r] == 1 iff x in row r.

Constraints are left as an exercise for the reader.

-- 
Michael   [email protected]
"Sorry but your password must contain an uppercase letter, a number,
a haiku, a gang sign, a heiroglyph, and the blood of a virgin."
                                                              --  someeecards
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.