We have utilized the general algorithm of simulated annealing (SA) to engineer the phase shifter domains in a quasi-phase-matching (QPM) device to generate multiple frequency conversion. SA is an algorithm generally used to find the global maxima or minima in a given random function. Here, we have utilized this algorithm to generate multiple QPM second harmonic generation (SHG) by distributing phase shifters suitably. In general, phase shifters are distributed in a QPM device with some specific profile along the length to generate multiple QPM SHG. Using the SA algorithm, the location of these phase shifters can be easily identified to have the desired multiple QPM with higher conversion efficiency. The methodology to generate the desired multiple QPM SHG using the SA algorithm has been discussed in detail.