unfortunetly I can't (sorry I'm not mathematicst) but I can phrase my problem in AMPL language. please look at the two files which I have pasted at the end of this email. mate-selection.mod contain optimization model in AMPL. the second file mate-selection.dat contain the example data.PETSc basically offers parallel linear algebra and nonlinear solvers. If you can phrase the algorithm in linear algebraic terms, then we can probably help.