Coherent and flat supercontinuum (SC) sources are demanded for applications of metrology, spectroscopy, and bio-imaging. However, the process of SC generation is usually very complicated. We demonstrated a convenient and efficient method based on a genetic algorithm (GA). According to an objective spectrum, this algorithm could reverse-design the geometry of a fiber or waveguide without knowing the specific non-linear processes involved. Using this method, we designed a dispersion-managed photonic crystal fiber (PCF) for SC generation at 1 GHz comb spacing. With an input pulse of ∼150 fs, 450 pJ at 1050 nm, a 3 dB fluctuation spectrum ranging from 510 nm to 850 nm is obtained, which is absolutely fit to the calibration of an astronomical spectrograph.