We propose and experimentally demonstrate a new scheme for flexible multiwavelength conversion that uses the genetic algorithm with two target functions to optimize the nonperiodic optical superlattice (NOS). Compared to the widely used aperiodic optical superlattice approach, our scheme can achieve similar to 15% higher overall conversion efficiency, better spectral fidelity, and allows for further improvement of the performances if a larger genetic pool is used. Numerical analysis also shows that the resulting conversion efficiency spectrum is rather insensitive to typical fabrication errors, and is distorted under pump depletion in a similar scale as that of a periodic quasi-phase matching grating. Experimentally measured conversion efficiency spectra of the two fabricated NOS devices are in good agreement with the target curves. (C) 2010 Optical Society of America