KR101105652B1 - Method of creating directivity graph for search nonsuperstring non-inclusion - Google Patents

Method of creating directivity graph for search nonsuperstring non-inclusion Download PDF

Info

Publication number
KR101105652B1
KR101105652B1 KR1020100017799A KR20100017799A KR101105652B1 KR 101105652 B1 KR101105652 B1 KR 101105652B1 KR 1020100017799 A KR1020100017799 A KR 1020100017799A KR 20100017799 A KR20100017799 A KR 20100017799A KR 101105652 B1 KR101105652 B1 KR 101105652B1
Authority
KR
South Korea
Prior art keywords
string
suffix
node
leaf
prefix
Prior art date
Application number
KR1020100017799A
Other languages
Korean (ko)
Other versions
KR20110098265A (en
Inventor
심정섭
이문규
나중채
최시원
Original Assignee
인하대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 인하대학교 산학협력단 filed Critical 인하대학교 산학협력단
Priority to KR1020100017799A priority Critical patent/KR101105652B1/en
Publication of KR20110098265A publication Critical patent/KR20110098265A/en
Application granted granted Critical
Publication of KR101105652B1 publication Critical patent/KR101105652B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/137Hierarchical processing, e.g. outlines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Abstract

본 발명은 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에 관한 것으로서, 보다 구체적으로는 (1) 금지문자열 집합의 부분 문자열을 표시한 일반화접미사트리의 모든 노드들에 대해 조상들 중 접미사 노드를 만족하는 가장 가까운 노드인 최근접 접미사 조상 노드를 계산하는 단계; (2) 상기 일반화접미사트리의 모든 리프의 문자열에 각 문자를 접두사로 형성한 문자열인 접두사문자열의 최장 접두사를 만족하는 리프를 정의하는 링크함수를 계산하는 단계; 및 (3) 상기 링크함수를 이용하여, 문자열을 통과시키는 경우 금지문자열 불포함 여부를 판단하는 방향 그래프를 생성하는 단계를 포함하는 것을 그 구성상의 특징으로 한다.
본 발명에서 제안하고 있는, 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에 따르면, 최근접 접미사 노드를 계산하는 단계, 및 링크함수를 계산하는 단계를 포함하여 방향 그래프를 생성함으로써, 주어진 문자열을 포함하지 않는 문자열 불포함 문제를 선형시간에 방향 그래프를 구성하여 능률적으로 해결할 수 있다.
The present invention relates to a method for generating a direction graph for determining that a prohibited string is not included. More specifically, (1) all nodes of a generalized suffix tree representing a substring of a prohibited string set satisfy a suffix node among ancestors. Computing a nearest suffix ancestor ancestor node; (2) calculating a link function defining a leaf that satisfies the longest prefix of the prefix string, which is a string formed by prefixing each character in the strings of all the leaves of the generalized suffix tree; And (3) using the link function to generate a direction graph for determining whether or not a prohibited string is included when passing the character string.
According to the method proposed in the present invention, the direction graph generation method for determining whether a prohibited string is included does not include a given string by generating a direction graph including calculating a closest suffix node and calculating a link function. This problem can be efficiently solved by constructing a direction graph in linear time.

Description

금지문자열 불포함 결정을 위한 방향 그래프 생성 방법{METHOD OF CREATING DIRECTIVITY GRAPH FOR SEARCH NONSUPERSTRING NON-INCLUSION}METHODS OF CREATING DIRECTIVITY GRAPH FOR SEARCH NONSUPERSTRING NON-INCLUSION}

본 발명은 검색을 위한 방향 그래프 생성 방법에 관한 것으로서, 특히 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에 관한 것이다.The present invention relates to a method for generating a direction graph for retrieval, and more particularly, to a method for generating a direction graph for determining whether a prohibited string is not included.

문자열 포함 문제는 주어진 문자열들의 공통 부분서열 중 가장 긴 서열(Longest Common Subsequence)을 찾는 문제와 공통 상위서열 중 가장 짧은 서열(Shortest Common Subsequence)을 찾는 문제 등이 연구되어 왔다. 한편, 주어진 문자열을 포함하지 않는 문자열 불포함 문제가 압축 알고리즘, 분자 생물학, 컴퓨터 보안 등 다양한 분야에서 필요성이 대두되어 진행되고 있다.
The problem of string inclusion has been studied such as finding the longest common subsequence of the common subsequences of a given string and finding the shortest sequence of the common supersequence (Shortest Common Subsequence). On the other hand, the problem of not including a given string does not include a string of problems in the compression algorithm, molecular biology, computer security, etc.

문자열 집합 F가 입력으로 주어졌을 때, 만약 문자열 x가 F 내의 모든 금지문자열 fi(1≤i≤m)를 포함하지 않으면, x를 F의 공통 비상위문자열(Common NonSuperString)이라 한다. 또한, 문자열 x가 유한길이이고, F의 공통 비상위문자열들 중 가장 긴 문자열이면, x를 F의 최장 공통 비상위문자열( Longest Common NonSuperString)이라 한다. 편의를 위하여, 상기 공통 비상위문자열과 최장 공통 비상위문자열을 각각 CNSS와 LCNSS라 나타낸다. 또한, F의 모든 문자열의 길이의 합을 ∥F∥로 표시하기로 한다.
Given a string set F as input, if the string x does not contain all of the forbidden strings f i (1≤i≤m) in F, then x is called F's Common NonSuperString. In addition, if the string x is a finite length and is the longest string among the common emergency strings of F, x is called F's longest common nonsuperstring. For convenience, the common emergency string and the longest common emergency string are referred to as CNSS and LCNSS, respectively. Also, let's denote the sum of the lengths of all strings in F as ∥F∥.

최장 공통 비상위문자열 문제를 문자열들의 모든 적당한 접미사를 표시한 방향성 그래프를 구성하여 다항 시간에 풀 수 있는 것이 알려져 있으나, 시간이 오래 걸리는 등의 능률적이지 못한 문제점이 있다.It is known that the longest common emergency string problem can be solved in polynomial time by constructing a directional graph that shows all the proper suffixes of the strings, but there is an inefficient problem such as a long time.

본 발명은 기존에 제안된 방법들의 상기와 같은 문제점들을 해결하기 위해 제안된 것으로서, 최근접 접미사 노드를 계산하는 단계, 및 링크함수를 계산하는 단계를 포함하여 방향 그래프를 생성함으로써, 주어진 문자열을 포함하지 않는 문자열 불포함 문제를 선형시간에 방향 그래프를 구성하여 능률적으로 해결하는 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법을 제공하는 것을 그 목적으로 한다.The present invention has been proposed to solve the above problems of the conventionally proposed methods, and includes a given string by generating a direction graph including calculating a closest suffix node, and calculating a link function. It is an object of the present invention to provide a method for generating a direction graph for determining a non-prohibited string that efficiently solves a problem of not including a string that does not contain a string.

상기한 목적을 달성하기 위한 본 발명의 특징에 따른, 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법은,According to an aspect of the present invention for achieving the above object, a method for generating a direction graph for determining whether a prohibited string is included,

금지문자열 집합의 부분 문자열을 표시한 일반화접미사트리의 모든 노드들에 대해 조상들 중 접미사 노드를 만족하는 가장 가까운 노드인 최근접 접미사 조상 노드를 계산하는 단계,Calculating the nearest suffix ancestor node, which is the closest node that satisfies the suffix node among the ancestors, for all nodes of the generalized suffix tree representing the substring of the set of prohibited strings,

상기 일반화접미사트리의 모든 리프의 문자열에 각 문자를 접두사로 형성한 문자열인 접두사문자열의 최장 접두사를 만족하는 리프를 정의하는 링크함수를 계산하는 단계, 및Calculating a link function defining a leaf that satisfies the longest prefix of the prefix string, which is a string formed by prefixing each character in the strings of all the leaves of the generalized suffix tree; and

상기 링크함수를 이용하여, 문자열을 통과시키는 경우 금지문자열 불포함 여부를 판단하는 방향 그래프를 생성하는 단계를 포함하는 것을 그 구성상의 특징으로 한다.
And a step of generating a direction graph for determining whether a prohibited string is not included when passing a string using the link function.

바람직하게는, 최근접 접미사 조상 노드를 계산하는 상기 단계는,Preferably, the step of calculating the nearest suffix ancestor node,

노드가 상기 금지문자열 집합과 상기 금지문자열 집합의 진접미사 집합의 합집합에 속하는 접미사 노드인 경우에 자신이고, 노드가 접미사 노드가 아닌 경우에는 조상들 중 접미사 노드를 만족하는 가장 가까운 노드이므로 각 노드마다 상수 시간에 해결되어 선형시간에 계산할 수 있다.
If the node is a suffix node belonging to the union of the forbidden string set and the suffix set of the forbidden string set, the node is itself. If the node is not a suffix node, the node is the closest node that satisfies the suffix node. Solved in time, can be calculated in linear time.

바람직하게는, 링크함수를 계산하는 상기 단계는,Preferably, the step of calculating the link function,

리프가 상기 최근접 접미사 조상 노드이면 상기 접두사문자열의 최장 접두사를 만족하는 리프가 상기 접두사문자열을 만족하는 리프일 수 있다.
If a leaf is the nearest suffix ancestor node, a leaf that satisfies the longest prefix of the prefix string may be a leaf that satisfies the prefix string.

바람직하게는, 링크함수를 계산하는 상기 단계는,Preferably, the step of calculating the link function,

상기 접두사문자열이 접미사 노드이면 상기 접두사문자열의 최장 접두사를 만족하는 리프를 계산하고, 상기 접두사문자열이 접미사 노드가 아니면 부모 노드의 최근접 접미사 조상 노드를 계산하고 이의 최장 접두사를 만족하는 리프를 계산할 수 있다.
If the prefix string is a suffix node, a leaf that satisfies the longest prefix of the prefix string is calculated. have.

바람직하게는, 방향 그래프를 생성하는 상기 단계는,Preferably, the step of generating a direction graph,

상기 일반화접미사트리의 리프가 금지문자열 집합에 속하면 정점을 생성하지 않고, 리프가 진접미사 집합에 속하면 정점을 생성하는 단계; 및Generating a vertex if the leaf of the generalized suffix tree belongs to a forbidden string set, and generating a vertex if the leaf belongs to a set of true suffixes; And

상기 링크함수를 이용하여 최장 접두사가 금지문자열 집합에 속하면 간선을 생성하지 않고, 최장 접두사가 진접미사 집합에 속하면 상기 접두사문자열의 최장 접두사를 만족하는 리프로부터 기존 리프로 도달하는 간선을 생성하는 단계를 포함하여 방향 그래프를 선형 시간에 생성할 수 있다.By using the link function, if the longest prefix belongs to the forbidden string set, no edge is generated, and if the longest prefix belongs to the set of true prefixes, an edge that reaches an existing leaf from a leaf that satisfies the longest prefix of the prefix string is generated. Including a step, a direction graph can be generated in linear time.

본 발명에서 제안하고 있는, 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에 따르면, 최근접 접미사 노드를 계산하는 단계, 및 링크함수를 계산하는 단계를 포함하여 방향 그래프를 생성함으로써, 주어진 문자열을 포함하지 않는 문자열 불포함 문제를 선형시간에 방향 그래프를 구성하여 능률적으로 해결할 수 있다.According to the method proposed in the present invention, the direction graph generation method for determining whether a prohibited string is included does not include a given string by generating a direction graph including calculating a closest suffix node and calculating a link function. This problem can be efficiently solved by constructing a direction graph in linear time.

도 1은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법의 구성을 나타내는 도면.
도 2는 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 최근접 접미사 조상 노드를 계산하는 단계의 세부 구성을 나타내는 도면.
도 3은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 금지 문자열 집합이 F={aaa, aba, abb, bbb}인 일반화접미사트리를 나타내는 도면.
도 4는 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 링크함수를 계산하는 단계의 세부 구성을 나타내는 도면.
도 5는 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 금지 문자열 집합이 F={aaa, aba, abb, bbb}인 링크함수를 나타내는 도면.
도 6은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 링크함수 계산 과정을 나타내는 도면.
도 7은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 방향 그래프를 생성하는 단계의 세부 구성을 나타내는 도면.
도 8은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 금지 문자열 집합이 F={aaa, aba, abb, bbb}인 방향 그래프를 나타내는 도면.
1 is a view showing the configuration of a method for generating a direction graph for determining whether a prohibited string is not included in accordance with an embodiment of the present invention.
2 is a diagram showing the detailed configuration of the step of calculating the nearest suffix ancestor node in the method for generating a direction graph for determining whether to inhibit the prohibited string according to an embodiment of the present invention.
3 is a diagram illustrating a generalized suffix tree in which a set of prohibited strings is F = {aaa, aba, abb, bbb} in a method of generating a direction graph for determining whether a prohibited string is not included according to an embodiment of the present invention.
4 is a diagram illustrating a detailed configuration of a step of calculating a link function in a direction graph generation method for determining whether a prohibited string is not included according to an embodiment of the present invention.
FIG. 5 is a diagram illustrating a link function in which a prohibition string set is F = {aaa, aba, abb, bbb} in a method of generating a direction graph for determining whether a prohibition string is included according to an embodiment of the present invention. FIG.
6 is a diagram illustrating a link function calculation process in a direction graph generation method for determining whether a prohibited string is not included according to an embodiment of the present invention.
FIG. 7 is a diagram illustrating a detailed configuration of generating a direction graph in a direction graph generation method for determining whether a prohibited string is not included according to an embodiment of the present invention; FIG.
8 is a diagram illustrating a direction graph in which a set of prohibited strings is F = {aaa, aba, abb, bbb} in the method for generating a direction graph for determining whether a prohibited string is not included according to an embodiment of the present invention.

이하에서는 첨부된 도면을 참조하여 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명을 용이하게 실시할 수 있도록 바람직한 실시예를 상세히 설명한다. 다만, 본 발명의 바람직한 실시예를 상세하게 설명함에 있어, 관련된 공지 기능 또는 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략한다. 또한, 유사한 기능 및 작용을 하는 부분에 대해서는 도면 전체에 걸쳐 동일 또는 유사한 부호를 사용한다.
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily carry out the present invention. However, in describing the preferred embodiment of the present invention in detail, if it is determined that the detailed description of the related known function or configuration may unnecessarily obscure the subject matter of the present invention, the detailed description thereof will be omitted. The same or similar reference numerals are used throughout the drawings for portions having similar functions and functions.

덧붙여, 명세서 전체에서, 어떤 부분이 다른 부분과 ‘연결’되어 있다고 할 때, 이는 ‘직접적으로 연결’되어 있는 경우뿐만 아니라, 그 중간에 다른 소자를 사이에 두고 ‘간접적으로 연결’되어 있는 경우도 포함한다. 또한, 어떤 구성요소를 ‘포함’한다는 것은, 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있다는 것을 의미한다.
In addition, throughout the specification, when a part is 'connected' to another part, it is not only 'directly connected' but also 'indirectly connected' with another element in between. Include. In addition, the term 'comprising' of an element means that the element may further include other elements, not to exclude other elements unless specifically stated otherwise.

도 1은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법을 나타내는 도면이다. 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법은, 도 1에 도시된 바와 같이, 금지문자열 집합의 부분 문자열을 표시한 일반화접미사트리의 모든 노드들에 대해 조상들 중 접미사 노드를 만족하는 가장 가까운 노드인 최근접 접미사 조상 노드를 계산하는 단계(S100), 일반화접미사트리의 모든 리프의 문자열에 각 문자를 접두사로 형성한 문자열인 접두사문자열의 최장 접두사를 만족하는 리프를 정의하는 링크함수를 계산하는 단계(S200) 및 링크함수를 이용하여, 문자열을 통과시키는 경우 금지문자열 불포함 여부를 판단하는 방향 그래프를 생성하는 단계(S300)를 포함하여 구성될 수 있다. 방향 그래프에서 사이클의 여부를 검색해서 최장 공통 비상위문자열의 존재 여부를 판단하고, 방향 그래프가 사이클이 없는 유향 그래프(directed acyclic graph; DAG)이면, 방향 그래프의 최장 경로는 F의 최장 공통 비상위문자열과 대응된다. 방향 그래프의 최장 경로로부터 F의 최장 공통 비상위문자열은 최장 경로의 출발 정점으로부터 마지막 정점까지, 각 정점이 나타내는 문자열의 처음 문자를 순차적으로 연결시킴으로써 얻어진다. 만약 방향 그래프에 사이클이 존재한다면, 상기 방법에 따라 무한히 긴 공통 비상위문자열을 생성할 수 있으므로, 최장 공통 비상위문자열은 존재하지 않는다. 이와 같이, 본 발명에서는 최근접 접미사 노드를 계산하는 단계, 및 링크함수를 계산하는 단계를 포함하여 방향 그래프를 생성함으로써, 주어진 문자열을 포함하지 않는 문자열 불포함 문제를 선형시간에 방향 그래프를 구성하여 능률적으로 해결하고 있다.
1 is a diagram illustrating a method of generating a direction graph for determining whether a prohibited string is not included according to an embodiment of the present invention. As shown in FIG. 1, the method for generating a direction graph for determining the prohibition string is a closest node that satisfies the suffix node among the ancestors for all nodes of the generalized suffix tree indicating the substring of the prohibition string set. Computing the nearest suffix ancestor node (S100), calculating a link function defining a leaf that satisfies the longest prefix of the prefix string, which is a string formed by prefixing each character in the strings of all the leaves of the generalized suffix tree ( S200) and generating a direction graph for determining whether the prohibited string is not included when passing the character string using the link function (S300). Search the direction graph for cycles to determine the presence of the longest common emergency sequence string, and if the direction graph is a directed acyclic graph (DAG), then the longest path of the direction graph is the longest common emergency sequence for F. Matches a string. The longest common emergency string of F from the longest path of the direction graph is obtained by sequentially concatenating the first characters of the string represented by each vertex, from the start vertex to the last vertex of the longest path. If there is a cycle in the direction graph, then the longest common emergency string is not present because an infinitely long common emergency string can be generated according to the above method. As described above, in the present invention, by generating a direction graph including calculating a closest suffix node and calculating a link function, the direction graph can be efficiently constructed in a linear time to solve the problem of not including a given string. To solve.

도 2는 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 최근접 접미사 조상 노드를 계산하는 단계의 세부 구성을 나타내는 도면이고, 도 3은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 금지 문자열 집합이 F={aaa, aba, abb, bbb}인 일반화접미사트리를 나타내는 도면이다. 최근접 접미사 조상 노드를 계산하는 단계(S100)는, 도 2 및 도 3에 도시된 바와 같이, 노드가 금지문자열 집합과 금지문자열 집합의 진접미사 집합의 합집합에 속하는 접미사 노드인 경우에는 자신이고(S210), 노드가 접미사 노드가 아닌 경우에는 조상들 중 접미사 노드를 만족하는 가장 가까운 노드이므로(S220), 각 노드마다 상수 시간에 해결되어 선형시간에 계산할 수 있다.
2 is a diagram showing the detailed configuration of the step of calculating the nearest suffix ancestor node in the method for generating a direction graph for determining whether a prohibited string is not included in accordance with an embodiment of the present invention, Figure 3 is according to an embodiment of the present invention A diagram illustrating a generalized suffix tree in which a set of prohibited strings is F = {aaa, aba, abb, bbb} in the direction graph generation method for determining whether a prohibited string is included. Computing the nearest suffix ancestor node (S100) is self if the node is a suffix node belonging to the union of the prohibition string set and the proximal suffix set of the prohibition string set, as shown in FIGS. 2 and 3 (S210). If the node is not a suffix node, since it is the closest node that satisfies the suffix node among the ancestors (S220), each node can be solved in constant time and calculated in linear time.

두 문자열 α, β의 연결(concatenations)을 αβ 라고 표기하고, 문자열 α의 길이를 |α|로 표기하며, α의 i번째 문자는 α[i]로 나타내기로 하는 경우, 공백 문자열의 길이는 |ε|=0이다. 문자열 β가 α[i]α[i+1]…α[j]의 연결이라고 할 때, β를 α[i…j]라 표기하고, β를 α의 부분문자열(substring)이라 한다. 반대로 α를 β의 상위문자열(superstring)이라 한다. 문자열 α에서 i≤|α|일 때 α[ij]를 α의 접두사(prefix)라 하고, i<|α|일 때 α[i…j]를 α의 진접두사(proper prefix)라 한다. 유사하게 i≥1일 때 α[i…|α|]를 α의 접미사(suffix)라 하고, i>1일 때 α[i…|α|]를 α의 진접미사(proper suffix)라 한다.
The concatenation of two strings α and β is denoted by αβ, the length of the string α is denoted by | α |, and the i-th character of α is denoted by α [i]. ε | = 0. The character string β is alpha [i] alpha [i + 1]... β is the α [i ... j] and β is called a substring of α. In contrast, α is called the superstring of β. Α [ij] is a prefix of α when i ≦ | α | in the character string α, and α [i…] when i <| α | j] is called the prefix prefix of α. Similarly, when i≥1, α [i... | α |] is referred to as the suffix of α, and when i > | α |] is called the proper suffix of α.

단말 정점에 있는 숫자는 접미사의 인덱스이고, 간선에 표시된 문자열은 각 간선이 나타내는 부분 문자열로서 접미사 트리의 단말 정점은 각 접미사와 일대일 대응을 이룬다. 따라서 단말 정점의 개수는 접미사 개수의 수와 같다. 그리고 모든 내부 정점은 두 개 이상의 자식을 가지므로 전체 정점의 수는 접미사 개수의 2배를 넘지 않는다. 그리고 각 정점은 문자열을 표시하기 위해 시작과 끝 위치를 저장하므로 접미사 트리를 유지하기 위한 저장 공간은 문자열의 길이에 비례한다. 그러므로 일반화접미사트리는 선형 시간에 생성될 수 있으므로, 일반화접미사트리는 O(∥F∥)에 완료할 수 있다.
The number at the terminal vertex is the index of the suffix, and the string displayed on the edge is a substring represented by each edge, and the terminal vertex of the suffix tree has one-to-one correspondence with each suffix. Thus, the number of terminal vertices is equal to the number of suffixes. And since every internal vertex has more than one child, the total number of vertices is no more than twice the number of suffixes. Each vertex stores its start and end positions to represent the string, so the storage space for holding the suffix tree is proportional to the length of the string. Therefore, the generalized suffix tree can be generated in linear time, so the generalized suffix tree can complete at O (∥F∥).

금지문자열로 구성된 집합 F={f1, f2, …, fm} 내의 모든 금지문자열 fi(1≤i≤m)의 진접미사 집합을 S라 하자. S에 n개의 서로 다른 원소가 있다고 가정하면 S={s1, …, sn}이다. 일반화접미사트리를 전위(preorder) 탐색하여 모든 노드들에 대해 최근접 접미사 조상 노드를 계산한다. 일반화접미사트리의 정점들의 최근접 접미사 조상 노드를 계산하는 단계(S100)에서, 일반화접미사트리에서 노드가 금지문자열 집합과 금지문자열 집합의 진접미사 집합의 합집합(S∪F)에 속하는 노드를 접미사 정점(suffix-node)이라 한다. 따라서 x가 접미사 노드이면 x의 자식(leaf) 노드 y에 대해 label(x,y)=$를 만족한다. 이때 리프 y를 x의 접미사 노드(suffix-node)라 한다. 정점 x의 최근접 접미사 조상(nearest suffix-ancestor) z는, x의 조상들 중 접미사 정점을 만족하는 가장 가까운 정점을 의미한다. 만약 노드가 접미사 노드이면 자신이 최근접 접미사 조상 노드이고(S110), 그렇지 않으면 부모의 최근접 접미사 조상 노드가 최근접 접미사 조상 노드가 된다(S220). 이 연산은 각 노드마다 상수 시간에 해결되므로 최근접 접미사 조상 노드의 계산은 O(∥F∥)의 선형 시간에 완료될 수 있다.
Set of forbidden strings F = {f 1 , f 2 ,... , f m } Let all of the forbidden strings f i (1 ≦ im ) in S be the set of S. Assuming n different elements in S, S = {s 1 ,... , s n }. Preorder the generalized suffix tree to compute the nearest suffix ancestor node for all nodes. In the step S100 of calculating the nearest suffix ancestor nodes of vertices of the generalized suffix tree, the nodes in the generalized suffix tree belong to the union (S∪F) of the set of forbidden string sets and the suffix set of forbidden string sets. suffix-node). Thus, if x is a suffix node, then label (x, y) = $ is satisfied for the leaf node y of x. The leaf y is called the suffix-node of x. The nearest suffix-ancestor z of vertex x means the closest vertex that satisfies the suffix vertex among the ancestors of x. If the node is a suffix node, it is the nearest suffix ancestor node (S110), otherwise the closest suffix ancestor node of the parent becomes the closest suffix ancestor node (S220). Since this operation is solved in constant time for each node, the calculation of the nearest suffix ancestor node can be completed in a linear time of O (∥F∥).

도 4는 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 링크함수를 계산하는 단계의 세부 구성을 나타내는 도면이고, 도 5는 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 금지 문자열 집합이 F={aaa, aba, abb, bbb}인 링크함수를 나타내는 도면이다. 링크함수를 계산하는 단계(S200)에서는, 도 4 및 도 5에 도시된 바와 같이, 리프가 최근접 접미사 조상 노드이면 접두사문자열의 최장 접두사를 만족하는 리프가 상기 접두사문자열을 만족하는 리프로 판단할 수 있다.
4 is a diagram illustrating a detailed configuration of a step of calculating a link function in a direction graph generation method for determining whether a prohibited string is not included according to an embodiment of the present invention, and FIG. 5 is not including a prohibited string according to an embodiment of the present invention. In the method for generating a direction graph for determining, a diagram showing a link function whose set of prohibited strings is F = {aaa, aba, abb, bbb}. In the calculating of the link function (S200), as shown in FIGS. 4 and 5, when the leaf is the nearest suffix ancestor node, a leaf that satisfies the longest prefix of the prefix string may be determined as a leaf that satisfies the prefix string. Can be.

링크함수를 계산하는 단계(S200)에서, 일반화접미사트리의 각 리프 li와 각 문자 σ(∈Σ)의 쌍에 대해 link(li,σ)를 다음과 같이 정의한다. 문자열 σstr(li)의 접두사중 S∪F에 속하는 최장 접두사를 α라 할 때, str(lj)=α를 만족하는 리프 lj를 계산할 수 있다. 일반화접미사트리는 S∪F의 모든 문자열을 나타내므로 lj는 항상 존재한다. 이때, link(li,σ)=lj로 정의된다. 특히, 리프가 최근접 접미사 조상 노드이면 접두사문자열의 최장 접두사를 만족하는 리프가 상기 접두사문자열을 만족하는 리프로 판단할 수 있다.
In the step S200 of calculating the link function, link (l i , σ) is defined as follows for each pair of leaf l i and each letter σ (∈Σ) of the generalized suffix tree. String Assuming that the longest prefix belonging to S ∪ F of σstr (l i ) is α, a leaf l j satisfying str (l j ) = α can be calculated. The generalized suffix tree represents all strings in S∪F, so l j is always present. At this time, link (l i , σ) = l j is defined. In particular, if the leaf is the nearest suffix ancestor node, the leaf that satisfies the longest prefix of the prefix string may be determined to be the leaf that satisfies the prefix string.

도 6은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 링크함수를 계산하는 과정을 나타내는 도면이다. 링크함수를 계산하는 단계(S200)는, 도 6에 도시된 바와 같이, 접두사문자열이 접미사 노드이면 접두사문자열의 최장 접두사를 만족하는 리프를 계산하고(S210), 접두사문자열이 접미사 노드가 아니면 부모 노드의 최근접 접미사 조상 노드를 계산하고 이의 최장 접두사를 만족하는 리프를 계산함으로써(S220) 수행될 수 있다.
FIG. 6 is a diagram illustrating a process of calculating a link function in a method for generating a direction graph for determining whether a prohibited string is not included, according to an embodiment of the present invention. In step S200, as shown in FIG. 6, if the prefix string is a suffix node, a leaf satisfying the longest prefix of the prefix string is calculated (S210), and if the prefix string is not a suffix node, the parent node is shown. It may be performed by calculating the nearest suffix ancestor node of and calculating a leaf that satisfies its longest prefix (S220).

링크함수를 계산하는 단계(S200)에서는, 일반화접미사트리의 모든 리프의 문자열에 각 문자를 접두사로 형성한 문자열인 접두사문자열의 최장 접두사를 만족하는 리프를 정의한다. 접두사문자열이 S∪F에 속하는 경우에 대해서 link(li,σ)를 계산할 때, 접미사 리스트 sl(i)를 이용한다. sl(i)의 각 원소 중 q≠1인 <p,q>(∈sl(i))에 대해, str(li)=fp[q-1…|fp|]를 만족하는 리프 li를 계산한다. 접두사문자열이 S∪F에 속하지 않는 경우에 대해서 ink(li,σ)를 계산할 때, 다른 리프의 링크함수를 이용한다. 문자열 α를 str(li)의 진접두사 중 S∪F에 속하는 최장 문자열이라고 할 때, L(w)=α를 만족하는 접미사 노드 w를 구한다. w는 L(w)≠str(li)를 만족하는 li의 최근접 접미사 조상이다. 다음으로 li의 부모 노드 x를 계산한다. 만약 label(x,li)≠$이면, w가 최근접 접미사 조상 노드이고, 그렇지 않으면 부모 노드의 최근접 접미사 조상 노드로 계산된다. 이제 lk를 w의 접미사 리프라 하자. 최종적으로 link(li,σ)=link(lk,σ)를 통하여 계산된다.
In the step of calculating the link function (S200), a leaf that satisfies the longest prefix of the prefix string, which is a string formed by prefixing each character, is defined in the strings of all the leaves of the generalized suffix tree. The suffix list sl (i) is used to calculate link (l i , σ) for the case where the prefix string belongs to S∪F. For <p, q>(# sl (i)) where q ≠ 1 in each element of sl (i), str (l i ) = f p [q-1... Compute leaf l i that satisfies | f p |]. When calculating the ink (l i , σ) for the case where the prefix string does not belong to S∪F, the link function of another leaf is used. When the string α is the longest string belonging to S∪F among the prefixes of str (l i ), the suffix node w that satisfies L (w) = α is obtained. w is the nearest suffix ancestor of l i that satisfies L (w) ≠ str (l i ). Next, compute the parent node x of l i . If label (x, l i ) ≠ $, w is the nearest suffix ancestor node, otherwise it is computed as the nearest suffix ancestor node of the parent node. Let l k be the suffix leaf of w. Finally calculated via link (l i , σ) = link (l k , σ).

도 7은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 방향 그래프를 생성하는 단계의 세부 구성을 나타내는 도면이고, 도 8은 본 발명의 일실시예에 따른 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법에서 금지 문자열 집합이 F={aaa, aba, abb, bbb}인 방향 그래프를 나타내는 도면이다. 방향 그래프를 생성하는 단계(S300)는, 도 7 및 도 8에 도시된 바와 같이, 일반화접미사트리의 리프가 금지문자열 집합에 속하면 정점을 생성하지 않고, 리프가 진접미사 집합에 속하면 정점을 생성하는 단계(S310), 및 링크함수를 이용하여 최장 접두사가 금지문자열 집합에 속하면 간선을 생성하지 않고, 최장 접두사가 진접미사 집합에 속하면 접두사문자열의 최장 접두사를 만족하는 리프로부터 기존 리프로 도달하는 간선을 생성하는 단계(S320)를 포함하여 방향 그래프를 선형시간에 생성할 수 있다.
7 is a diagram illustrating a detailed configuration of generating a direction graph in the direction graph generation method for determining whether a prohibited string is not included according to an embodiment of the present invention, and FIG. 8 is not included in the prohibited string according to an embodiment of the present invention. In the method of generating a direction graph for determination, a diagram illustrating a direction graph in which a set of prohibited strings is F = {aaa, aba, abb, bbb}. 7 and 8, when the leaf of the generalized suffix tree belongs to the forbidden string set, the vertex is not generated, and the leaf is included in the true suffix set as shown in FIGS. 7 and 8. In step S310, and using the link function, if the longest prefix belongs to the forbidden string set, no edge is generated, and if the longest prefix belongs to the true prefix set, the leaf satisfies the longest prefix of the prefix string from the leaf to the existing leaf. The direction graph may be generated in a linear time, including the step of generating the reaching edge (S320).

금지문자열 집합의 진접미사 집합으로 정점들을 표시하는 단계(S310)에서, F 내의 모든 금지문자열 fi(1≤i≤m)의 진접미사 집합을 S라 하고, S에 n개의 서로 다른 원소가 있다고 가정하면 즉, S={s1, …, sn}이면 정점 집합(set of vertices) V는 각 si∈S(1≤i≤n)에 대해, 새로운 정점 vi가 대응된다. 따라서 정점 집합 V와 진접미사 집합 S는 1:1 대응된다.
In the step S310 of displaying the vertices of the forbidden string set as the set of pseudo-suffixes, the set of the pseudo-suffixes of all forbidden strings f i (1 ≦ i ≦ m) in F is S, and there are n different elements in S. Assume that S = {s 1 ,... , s n }, a set of vertices V corresponds to a new vertex v i for each s i ∈S (1 ≦ i ≦ n). Therefore, the vertex set V and the pseudo-similar set S correspond to 1: 1.

표시된 정점들 사이를 상기 접두사문자열의 최장 접두사를 만족하는 리프로부터 기존 리프로 도달하는 방향으로 간선을 생성하는 단계(S320)의 간선 집합(set of edges) E는 우선 각 si∈S(1≤i≤n)에 대해, Pi σ를 다음과 같이 정의한다. Pi σ={y|y∈S∪F이고 y는 σsi의 접두사이다} 또한, Pi σ의 원소 중 가장 긴 문자열이 sj(∈S)일 때, 대응되는 정점 vj에서 vi로 향하는 간선을 정의한다. 즉, 임의의 두 정점의 쌍 <vj,vi>에 대해서, vj에서 vi로 가는 간선이 존재한다 함은, Pi sj [1]의 원소 중 가장 긴 문자열이 sj임을 의미한다. 또한 Pi σ의 원소 중 가장 긴 문자열이 F에 속할 때, 어떠한 간선도 정의되지 않는다. 각 si∈S와 σ∈Σ에 대해, 하나의 간선만 정의되므로, 각 정점마다 기껏해야 |Σ|만큼의 들어오는 간선만 정의된다. 따라서 상수 크기 알파벳에서, 총 간선의 수는 O(∥F∥)에 바운드된다.
The set of edges E in the step S320 of generating the edges between the displayed vertices in a direction from the leaf that satisfies the longest prefix of the prefix string to the existing leaf (S320) is first used for each s i ∈ S (1 ≦ 1). for i≤n), a P i σ is defined as follows. P i σ = {y | y∈S∪F and y is the prefix of σs i } Also, when the longest string of the elements of P i σ is s j (∈S), the corresponding vertices v j to v i Define the edge leading to. In other words, for any pair of vertices <v j , v i >, the edge from v j to v i is present, which means that the longest string of the elements of P i sj [1] is s j . . In addition, when the longest character string of the element of P i σ belong to F, nor is any definition arterial. For each s i 에 S and σ∈Σ, only one edge is defined, so that at most vertices only | Σ | incoming edges are defined for each vertex. Thus, in constant size alphabets, the total number of edges is bound to O (∥F∥).

이상 설명한 본 발명은 본 발명이 속한 기술분야에서 통상의 지식을 가진 자에 의하여 다양한 변형이나 응용이 가능하며, 본 발명에 따른 기술적 사상의 범위는 아래의 특허청구범위에 의하여 정해져야 할 것이다.The present invention described above may be variously modified or applied by those skilled in the art, and the scope of the technical idea according to the present invention should be defined by the following claims.

S100: 최근접 접미사 조상 노드를 계산하는 단계
S200: 링크함수를 계산하는 단계
S300: 방향 그래프를 생성하는 단계
S310: 리프가 진접미사 집합에 속하는 경우 정점을 생성하는 단계
S320: 최장 접두사가 진접미사 집합에 속하는 경우 간선을 생성하는 단계
S100: calculating the nearest suffix ancestor node
S200: step of calculating the link function
S300: step of generating a direction graph
S310: creating a vertex if the leaf belongs to a set of contiguous tails
S320: generating edges when the longest prefix belongs to the set of suffixes

Claims (5)

금지문자열 불포함 결정을 위한 방향 그래프 생성 방법으로서, 컴퓨터 계산 알고리즘 엔진에 의해 실행되며,
(1) 금지문자열 집합의 부분 문자열을 표시한 일반화접미사트리의 모든 노드들에 대해 조상들 중 접미사 노드를 만족하는 가장 가까운 노드인 최근접 접미사 조상 노드를 계산하는 단계;
(2) 상기 일반화접미사트리의 모든 리프의 문자열에 각 문자를 접두사로 형성한 문자열인 접두사문자열의 최장 접두사를 만족하는 리프를 정의하는 링크함수를 계산하는 단계; 및
(3) 상기 링크함수를 이용하여, 문자열을 통과시키는 경우 금지문자열 불포함 여부를 판단하는 방향 그래프를 생성하는 단계를 포함하는 것을 특징으로 하는, 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법.
A method of generating a direction graph for determining whether a prohibited string is included, which is executed by a computer calculation algorithm engine.
(1) calculating a closest suffix ancestor node, which is the closest node that satisfies the suffix node among the ancestors, for all nodes of the generalized suffix tree indicating the substring of the forbidden string set;
(2) calculating a link function defining a leaf that satisfies the longest prefix of the prefix string, which is a string formed by prefixing each character in the strings of all the leaves of the generalized suffix tree; And
And (3) generating a direction graph for determining whether or not a prohibited string is included in the case of passing the character string using the link function.
제1항에 있어서, 최근접 접미사 조상 노드를 계산하는 상기 단계는,
노드가 상기 금지문자열 집합과 상기 금지문자열 집합의 진접미사 집합의 합집합에 속하는 접미사 노드인 경우에 자신이고, 노드가 접미사 노드가 아닌 경우에는 조상들 중 접미사 노드를 만족하는 가장 가까운 노드이므로 각 노드마다 수학적 연산시간이 주어진 입력 자료에 관계없이 일정한 연산 시간을 갖는 상수 시간에 해결되어 선형시간에 계산되는 것을 특징으로 하는, 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법.
The method of claim 1, wherein calculating the nearest suffix ancestor node comprises:
If the node is a suffix node belonging to the union of the forbidden string set and the suffix set of the forbidden string set, and if the node is not a suffix node, the node is the closest node that satisfies the suffix node. A method for generating a direction graph for determining whether a forbidden string is not included, wherein an operation time is solved at a constant time having a constant operation time irrespective of a given input data and calculated in a linear time.
제1항에 있어서, 링크함수를 계산하는 상기 단계는,
리프가 상기 최근접 접미사 조상 노드이면 상기 접두사문자열의 최장 접두사를 만족하는 리프가 상기 접두사문자열을 만족하는 리프인 것을 특징으로 하는, 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법.
The method of claim 1, wherein the step of calculating the link function,
And a leaf that satisfies the longest prefix of the prefix string when the leaf is the nearest suffix ancestor ancestor is a leaf that satisfies the prefix string.
제1항에 있어서, 링크함수를 계산하는 상기 단계는,
상기 접두사문자열이 접미사 노드이면 상기 접두사문자열의 최장 접두사를 만족하는 리프를 계산하고, 상기 접두사문자열이 접미사 노드가 아니면 부모 노드의 최근접 접미사 조상 노드를 계산하고 이의 최장 접두사를 만족하는 리프를 계산하는 것을 특징으로 하는, 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법.
The method of claim 1, wherein the step of calculating the link function,
If the prefix string is a suffix node, calculate a leaf that satisfies the longest prefix of the prefix string. If the prefix string is not a suffix node, calculate a leaf that satisfies the suffix ancestor ancestor node of the parent node and calculate the leaf that satisfies its longest prefix. Characterized in that the direction graph for the determination of not including the forbidden string.
제1항에 있어서, 방향 그래프를 생성하는 상기 단계는,
상기 일반화접미사트리의 리프가 금지문자열 집합에 속하면 정점을 생성하지 않고, 리프가 진접미사 집합에 속하면 정점을 생성하는 단계; 및
상기 링크함수를 이용하여 최장 접두사가 금지문자열 집합에 속하면 간선을 생성하지 않고, 최장 접두사가 진접미사 집합에 속하면 상기 접두사문자열의 최장 접두사를 만족하는 리프로부터 기존 리프로 도달하는 간선을 생성하는 단계를 포함하는 것을 특징으로 하는, 금지문자열 불포함 결정을 위한 방향 그래프 생성 방법.
The method of claim 1, wherein generating the direction graph comprises:
Generating a vertex if the leaf of the generalized suffix tree belongs to a forbidden string set, and generating a vertex if the leaf belongs to a set of true suffixes; And
By using the link function, if the longest prefix belongs to the forbidden string set, no edge is generated, and if the longest prefix belongs to the set of true prefixes, an edge that reaches an existing leaf from a leaf that satisfies the longest prefix of the prefix string is generated. And generating a direction graph for determining whether a prohibited string is not included.
KR1020100017799A 2010-02-26 2010-02-26 Method of creating directivity graph for search nonsuperstring non-inclusion KR101105652B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020100017799A KR101105652B1 (en) 2010-02-26 2010-02-26 Method of creating directivity graph for search nonsuperstring non-inclusion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100017799A KR101105652B1 (en) 2010-02-26 2010-02-26 Method of creating directivity graph for search nonsuperstring non-inclusion

Publications (2)

Publication Number Publication Date
KR20110098265A KR20110098265A (en) 2011-09-01
KR101105652B1 true KR101105652B1 (en) 2012-01-18

Family

ID=44951845

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100017799A KR101105652B1 (en) 2010-02-26 2010-02-26 Method of creating directivity graph for search nonsuperstring non-inclusion

Country Status (1)

Country Link
KR (1) KR101105652B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19990015114A (en) * 1997-08-01 1999-03-05 구자홍 Character Recognizer Using Character Connection Information
JP2001034623A (en) 1999-07-19 2001-02-09 Matsushita Electric Ind Co Ltd Information retrievel method and information reteraval device
KR20080082700A (en) * 2007-03-09 2008-09-12 (주)넷피아닷컴 Method for processing native language internet address and storage medium for saving program of executing the same
KR20090106937A (en) * 2008-04-07 2009-10-12 삼성전자주식회사 Correction System for spelling error and method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19990015114A (en) * 1997-08-01 1999-03-05 구자홍 Character Recognizer Using Character Connection Information
JP2001034623A (en) 1999-07-19 2001-02-09 Matsushita Electric Ind Co Ltd Information retrievel method and information reteraval device
KR20080082700A (en) * 2007-03-09 2008-09-12 (주)넷피아닷컴 Method for processing native language internet address and storage medium for saving program of executing the same
KR20090106937A (en) * 2008-04-07 2009-10-12 삼성전자주식회사 Correction System for spelling error and method thereof

Also Published As

Publication number Publication date
KR20110098265A (en) 2011-09-01

Similar Documents

Publication Publication Date Title
Gagie et al. Wheeler graphs: A framework for BWT-based data structures
Bowe et al. Succinct de Bruijn graphs
JP2005525625A (en) Computer representation by data structure and related encoding / decoding method
US9619585B2 (en) Fast, scalable dictionary construction and maintenance
Arnold et al. Linear time algorithms for generalizations of the longest common substring problem
US8775457B2 (en) Efficient string matching state machine
Belazzougui et al. Bidirectional variable-order de Bruijn graphs
CN111370064A (en) Rapid gene sequence classification method and system based on SIMD hash function
US8612376B2 (en) System for generating character-string matching finite automation, its generating method, and generating program
Sawada et al. The lexicographically smallest universal cycle for binary strings with minimum specified weight
Katsura et al. Position heaps for parameterized strings
US20030187856A1 (en) Database and method for storing a searchable set of keywords
Benson et al. Longest common subsequence in k length substrings
Markenzon et al. One‐phase algorithm for the determination of minimal vertex separators of chordal graphs
KR101105652B1 (en) Method of creating directivity graph for search nonsuperstring non-inclusion
Schram et al. SAWdoubler: A program for counting self-avoiding walks
Allauzen et al. Simple optimal string matching algorithm
Lozano et al. On the maximum common embedded subtree problem for ordered trees
Crochemore et al. Directed acyclic subsequence graph—overview
US9165020B2 (en) String substitution apparatus, string substitution method and storage medium
Hendrian et al. Online algorithms for constructing linear-size suffix trie
Landau et al. Two algorithms for LCS consecutive suffix alignment
Goto et al. Speeding up q-gram mining on grammar-based compressed texts
Kociumaka et al. Faster recovery of approximate periods over edit distance
Hon et al. Space-efficient construction algorithm for the circular suffix tree

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20141204

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20160104

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20161220

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20171213

Year of fee payment: 7

LAPS Lapse due to unpaid annual fee