What version of IML are you using? If you are using PROC IML, the latest version, 9.22, allows you to submit arbitrary SAS code from inside your IML program via a SUBMIT block. So, if you have this version of IML and you have SAS/OR, you should be able to use the fast and exact solvers in SAS/OR to solve the optimization problem exactly and quickly (provided you have a manageable problem size). If you have an earlier version of SAS/IML, if you can use IML Studio that also has a SUBMIT block for submitting SAS code. It is possible to apply genetic algorithms (GA) in PROC IML to try to solve the optimization problem, but the problem with GA in general is that you are not guaranteed convergence, and if you do get a solution you have no way to know if it is the true global optimum. Also for a problem of this type, the integer linear programming solvers available in SAS/OR will use a fraction of the time that a GA would use. So, do you have a version of IML with the SUBMIT block available? If so that would be far preferable to trying to use GA.