Abstract:Generating short and readable regular expressions from finite automata is an important topic in computer theory. In the classical regular expression generation algorithms, the state sequence is the key factor that affects the quality of regular expressions. To search for excellent state sequences quickly and efficiently, this study takes the theory of the carnivorous plant algorithm as the core, combines the ideas of other heuristic algorithms for design and optimization, and proposes a state sequence search method based on the carnivorous plant algorithm. Through experiments, this method is compared with some existing search algorithms using heuristic rules. The experimental results demonstrate that the proposed state sequence search method is superior to other algorithms, and the length of the generated regular expressions is significantly shorter than that of other heuristic algorithms. For example, compared with the results of the DM algorithm, the length can be shortened by more than 20% with the increase in the order of automata, and compared with the results of the random sequence algorithm, the length can be shortened by several orders of magnitude.