Abstract:Objective To propose an efficient optimized method for food sampling inspection based on discrete sparrow search algorithm. To propose an efficient optimization method for food sampling inspection routes based on discrete sparrow search algorithm. Methods By coding the sampling points, calculating and optimizing the paths between different codes, a discrete sparrow search algorithm was constructed, compared and verified with other known algorithms. By coding the sampling points, calculating and optimizing the paths between different codes, a discrete sparrow search algorithm was constructed and compared and verified with other known algorithms. Results The discrete sparrow search algorithm constructed in this research could obtain the known optimal solution for Burma14, Bays29, Oliver30 and Att48, etc. For examples such as Kioa100 and Ch130, the deviation rates obtained by this algorithm were 0.1% and 1%, respectively, which were better than traditional genetic algorithms (the deviation rates were 3% and 4.2%, respectively). The discrete sparrow search algorithm constructed in this research, for Burma14, Bays29, Oliver30 and Att48, etc., this algorithm can obtain the known optimal solution. For examples such as Att48, Kioa100, and Ch130, the deviation rates obtained by this algorithm are 0,0.1%, and 1%, respectively, which are better than traditional genetic algorithms (the deviation rates are 1.5%, 3%, and 4.2%, respectively). Conclusion The food sampling path optimization method based on the discrete sparrow search algorithm created in this research had better performance in terms of solution accuracy and convergence speed, which was helpful to the actual work of double random sampling point generation and sampling path optimization. It provided feasible algorithmic support for the random inspection information system. The food sampling path optimization method based on the discrete sparrow search algorithm created in this research has better performance in terms of solution accuracy and convergence speed, which is helpful to the actual work of double random sampling point generation and sampling path optimization. The practicality of the “random” random inspection information system provides feasible algorithmic support.