Maximum Queens Chess Problem


    {  Queens.mpl  }

    {  GAMS Model Library, http://www.gams.com/modlib/libhtml/queens.htm  }

    {  Maximum Queens Chess Problem,  Assignment, Size: 42 x 64  }

TITLE
    Queens;

INDEX
    i := 1..8;
    s := 1..13;
    j := i;

DATA
    Sh[s]   := s - count(i) + 1;
    Rev[i]  := count(i) + 1 - 2 * i;

VARIABLE
    X[i,j];

MODEL

    MIN Tot = SUM(i,j: X);

SUBJECT TO

    A[i]:  SUM(j: X) = 1;

    B[j]:  SUM(i: X) = 1;

    C[s]:  SUM(i: X[i,j:=i+Sh]) <= 1;

    D[s]:  SUM(i: X[i,j:=i+Rev+Sh]) <= 1;

BINARY
    X;

END


Back To Top | Maximal Home Page | List of Models | Previous Page | Next Page