Automatic molecular design on computers is an emerging technology for the determination of optimal fuel molecules. We developed a computer-aided molecular design framework through a transformation rule-based molecular evolution method. The reaction rule was used as the elementary step to change the molecular structure. A molecule can achieve structural variation continuously using a series of reaction rules. The finding of the optimal molecule can be seen as the evolution of structure in the chemical space, which was guided by using a global optimization algorithm to select the best reaction routine. We showed that the optimized molecule is independent of the input initial structure, proving the robustness of the method. We then applied the method to design gasoline molecules for motor and aviation gasoline. The designed molecules can not only serve as competitive candidate components for high-quality gasoline, but also accelerate the synthesis rate of new molecules in the laboratory.