Question: minimax optimization error and failure

Please help me check why my minmax optimization is not having these errors:

Error, (in minimize/cell/function/multidependence/univariate) 

Error, n should be an integer for integer[n]
Error, (in minimize/cell/function/multidependence/univariate) invalid input: `minimize/continuous` expects its 2nd argument, yFP, to be of type {name, list(name)}, but received `X[4,3]` = -infinity

Error, invalid input: `convert/Array` expects its 1st argument, A, to be of type {Array, Matrix, Vector, array, sequential}, but received 0

my design optimization objective function is to carry out a minimize the maximum assignments from vector B overlap  between any two members in A , such that in vector A all members fall under a group and there is no duplication of membership, further   a member from each group representing the group  is to be assigned to vector B such that only one member of a group should be assigned each member of vector B, while ensuring that every member in vector B has represntation from every group in vector A. 

with(Optimization); num_profiles := 4; num_websites := 3; num_groups := 2; X := Array(1 .. num_profiles, 1 .. num_websites, datatype = integer[0 .. 1]); obj := minimize(max(seq(add(X[i, j], j = 1 .. num_websites), i = 1 .. num_profiles))); constraints := {seq(add(add(X[i, j], i = k*num_profiles/num_groups+1 .. (k+1)*num_profiles/num_groups), k = 0 .. num_groups-1) = 1, j = 1 .. num_websites)}; sol := Optimization[Minimize](obj, constraints, assume = binary); optimal_assignment := convert(sol[1], Array); for i to num_profiles do for j to num_websites do if optimal_assignment[i, j] = 1 then print("Profile ", i, " assigned to Website ", j) end if end do end do; print("Objective Value (Minimized Maximum Website Overlap): ", sol[2])

"Objective Value (Minimized Maximum Website Overlap): ", [obj = 0, X[1, 1] = 0, X[1, 2] = 0, X[1, 3] = 0, X[2, 1] = 0, X[2, 2] = 0, X[2, 3] = 1, X[3, 1] = 1, X[3, 2] = 1, X[3, 3] = 0, X[4, 1] = 0, X[4, 2] = 0, X[4, 3] = 0]

(1)

``

Download firstworkablecode.mw

Please Wait...