讨论带有限长空位和one—off约束条件的模式匹配问题,其中限长空位改变单个匹配解结构,one-off条件约束匹配解之间的关系,从而形成规模较大且稀疏的解空间.借鉴约束可满足性问题框架,将PMGO问题转化为图结构下的路径搜索问题,并证明转化的等价性.然后提出图结构下的剪枝和匹配算法(GPM),根据one-off约束得到节点之间的约束关系,再迭代交互地进行剪枝与搜索.实验中使用匹配解丢失率度量已有启发式算法和GPM的完备性,证明GPM可与已有启发式算法形成互补,有效降低匹配解丢失率.
The problem of pattern matching with bounded length gaps and one-off constraint (PMGO) is discussed. The structure of individual occurrences is changed by the bounded gaps, and the relation between occurrences is restricted by the one-off constraint. Thus, a large-scale sparse space of all candidate occurrences is generated. Based on the framework of the constraint satisfaction, the PMGO problem is transformed into path search in a directed acyclic graph (DAG) structure. Meanwhile, the equivalence of transformation is proved. Then, a graph-based pruning and matching (GPM) algorithm is presented. In GPM algorithm, a constraint relationship between vertexes is built under the one-off constraint, and then the path search is combined with a pruning procedure in an alternating and iterative manner. The loss rate of occurrences is used to measure existing heuristic algorithms and the completeness of the proposed GPM algorithm. The experimental results demonstrate that the GPM algorithm provides a complementary method for heuristic algorithms and it efficiently reduces the loss rate of occurrences.