This preview shows pages 1–2. Sign up to view the full content.
file:///C/Documents%20and%20Settings/mol23/Desktop/ORIE%203300_5300/assignments/ass2/ass2sols/ass21.txt
param N:=4;
var x{ i in 1.
.N, j in 1.
.N, t in 1.
.N} binary;
#x[i,j,t]=1 if entry in row i column j is assigned to be value
var v {i in 1.
.N, j in 1.
.N} integer;
maximize total_number_assigned: sum {i in 1.
.N, j in 1.
.N, t in 1.
.N}
x[i,j,t];
subject to cell111: x[1,1,1]=1;
subject to cell232: x[2,3,2]=1;
subject to cell314: x[3,1,4]=1;
subject to cell443: x[4,4,3]=1;
subject to Values {i in 1.
.N, j in 1.
.N}: v[i,j] = sum {t in 1.
.N}
t*x[i,j,t];
subject to AssignCell {i in 1.
.N, j in 1.
.N}:
sum {t in 1.
.N} x[i,j,t]<=1;
#each cell can be assigned at most one value
subject to AssignRow {i in 1.
.N, t in 1.
.N}:
sum {j in 1.
.N} x[i,j,t]<=1;
#each row's cells can have at most one of each value
subject to AssignColumn {j in 1.
.N, t in 1.
.N}:
sum {i in 1.
.N} x[i,j,t]<=1;
#each column's cells can have at most one of each value
subject to AssignBox {a in {1,3}, b in {1,3}, t in 1.
.N}:
sum {i in {a,a+1}, j in {b,b+1}} x[i,j,t]<=1;
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 09/29/2011 for the course ORIE 5300 taught by Professor Todd during the Fall '08 term at Cornell University (Engineering School).
 Fall '08
 TODD

Click to edit the document details