首页 | 本学科首页   官方微博 | 高级检索  
     检索      

基于混合策略的单模式匹配算法
引用本文:刘传汉,王永成,刘德荣,李党林.基于混合策略的单模式匹配算法[J].上海交通大学学报,2007,41(1):36-41.
作者姓名:刘传汉  王永成  刘德荣  李党林
作者单位:上海交通大学,计算机科学与工程系,上海,200030
基金项目:国家高技术研究发展计划(863计划)
摘    要:结合后缀有限自动机和正向有限自动机的优点,提出了两个单模式匹配算法.算法中,无论是后缀自动机还是正向有限自动机,只要扫描到的模式前缀长度R>0或者超过模式长度的1/2时,使用正向有限自动机继续向右进行扫描;否则都滑动m-R个字符,使用后缀自动机反向扫描模式串的前缀.两个算法的最差、最好时间复杂度分别为O(n)和O(n/m).结果表明,在短模式的情况下,两个算法的平均时间复杂度均好于RF和LDM,在小字符集长模式或大字符集短模式的情况下它们的平均性能好于BM.

关 键 词:模式匹配  LDM算法  后缀自动机  有限状态自动机  时间复杂度
文章编号:1006-2467(2007)01-0036-06
修稿时间:2006-01-15

Single Pattern Matching Algorithms Based on Hybrid Strategy
LIU Chuan-han,WANG Yong-cheng,LIU De-rong,LI Dang-lin.Single Pattern Matching Algorithms Based on Hybrid Strategy[J].Journal of Shanghai Jiaotong University,2007,41(1):36-41.
Authors:LIU Chuan-han  WANG Yong-cheng  LIU De-rong  LI Dang-lin
Institution:Dept. of Computer Science and Eng. , Shanghai Jiaotong Univ. , Shanghai 200030, China
Abstract:Two single pattern matching algorithms by combining a smallest suffix automaton and a forward finite state automaton were presented. Whatever the suffix automaton or the forward finite state automaton is running, the window shifts m-R characters and then the smallest suffix automaton starts searching the pattern prefixes from right to left if no pattern prefix is found or R is not greater than half of m,otherwise,the forward finite state automaton starts scanning forwards the corresponding suffixes of the pattern and the new matched prefixes of the pattern is recorded simultaneously.Their time complexities are O(n) in the worst case and O(n/m) in the best case.The experimental results show that their average time complexities are less than that of RF and LDM for short patterns and that of BM for long patterns over small alphabets or short patterns over large alphabets.
Keywords:pattern matching  linear DAWG matching(LDM) algorithm  suffix automaton  finite state automaton  time complexity
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号