Two Dimensional Matching

Author(s):  
A. Amir ◽  
M. Farach

String matching is a basic theoretical problem in computer science, but has been useful in implementating various text editing tasks. The explosion of multimedia requires an appropriate generalization of string matching to higher dimensions. The first natural generalization is that of seeking the occurrences of a pattern in a text where both pattern arid text are rectangles. The last few years saw a tremendous activity in two dimensional pattern matching algorithms. We naturally had to limit the amount of information that entered this chapter. We chose to concentrate on serial deterministic algorithms for some of the basic issues of two dimensional matching. Throughout this chapter we define our problems in terms of squares rather than rectangles, however, all results presented easily generalize to rectangles. The Exact Two Dimensional Matching Problem is defined as follows: . . . INPUT: Text array T[n x n] and pattern array P[m x m]. OUTPUT: All locations [i,j] in T where there is an occurrence of P, i.e. T[i+k+,j+l] = P[k+1,l+1] 0 ≤ k, l ≤ n-1. . . . A natural way of solving any generalized problem is by reducing it to a special case whose solution is known. It is therefore not surprising that most solutions to the two dimensional exact matching problem use exact string matching algorithms in one way or another. In this section, we present an algorithm for two dimensional matching which relies on reducing a matrix of characters into a one dimensional array. Let P' [1 . . .m] be a pattern which is derived from P by setting P' [i] = P[i,l]P[i,2]…P[i,m], that is, the ith character of P' is the ith row of P. Let Ti[l . . .n — m + 1], for 1 ≤ i ≤ n, be a set of arrays such that Ti[j] = T[i, j] T [ i , j + 1 ] • • • T[i, j + m-1]. Clearly, P occurs at T[i, j] iff P' occurs at Ti[j].

2017 ◽  
Vol Vol. 18 no. 2, Permutation... (Permutation Patterns) ◽  
Author(s):  
Both Neou ◽  
Romeo Rizzi ◽  
Stéphane Vialette

Given permutations σ of size k and π of size n with k < n, the permutation pattern matching problem is to decide whether σ occurs in π as an order-isomorphic subsequence. We give a linear-time algorithm in case both π and σ avoid the two size-3 permutations 213 and 231. For the special case where only σ avoids 213 and 231, we present a O(max(kn 2 , n 2 log log n)-time algorithm. We extend our research to bivincular patterns that avoid 213 and 231 and present a O(kn 4)-time algorithm. Finally we look at the related problem of the longest subsequence which avoids 213 and 231.


2006 ◽  
Vol 17 (06) ◽  
pp. 1235-1251 ◽  
Author(s):  
DOMENICO CANTONE ◽  
SIMONE FARO

Finite (nondeterministic) automata are very useful building blocks in the field of string matching. This is particularly true in the case of multiple pattern matching, where the use of factor-based automata can reduce substantially the number of computational steps when the patterns have large common factors. Direct simulation of nondeterministic automata can be performed very efficiently using the bit-parallelism technique, though this is not necessarily true for factor-based automata. In this paper we present an algorithm for the multiple string matching problem, based on the bit-parallel simulation of nondeterministic factor-based automata which satisfy a particular ordering condition. We also show how to enforce such condition by suitably modifying a minimal initial automaton, through equivalence preserving transformations. The resulting automaton turns out to be smaller than the corresponding maximal automata used by existing bit-parallel algorithms, as they do not take any advantage of common factors in patterns.


Author(s):  
IBRAHIEM M. M. EL EMARY ◽  
MOHAMMED S. M. JABER

The string matching problem consists of finding one or more, generally all, exact occurrences of a pattern P in a text T. This paper presents a new algorithm for solving the string matching problem. Application of the proposed algorithm assists in improving the search process of a specific pattern in a certain unchangeable text through decreasing the number of character comparisons. Operation concept of such an algorithm depends on pattern reading to obtain the pattern length and the pattern first character and then a search is done in a table of two columns: the first column represents the word length in the text and the second one represents the start positions of each word classified by the same length. After that the algorithm just searches the words of the same length. Our experimental results depend mainly on comparing the performance of our algorithm with the well-known pattern matching algorithms such as Boyer–Moor's and Boyer–Moor–Galil's. The comparison between our algorithm and others are done in terms of the number of characters compared for different sizes of text. The output results show that our algorithm performs better than the others in terms of this parameter.


2021 ◽  
Author(s):  
Anas Al-okaily ◽  
Abdelghani Tbakhi

Abstract Pattern matching is a fundamental process in almost every scientific domain. The problem involves finding the positions of a given pattern (usually of short length) in a reference stream of data (usually of large length). The matching can be as an exact or as an approximate (inexact) matching. Exact matching is to search for the pattern without allowing for mismatches (or insertions and deletions) of one or more characters in the pattern), while approximate matching is the opposite. For exact matching, several data structures that can be built in linear time and space are used and in practice nowadays. For approximate matching, the solutions proposed to solve this matching are non-linear and currently impractical. In this paper, we designed and implemented a structure that can be built in linear time and space and solve the approximate matching problem in (O(m + {log_Σ^k}n/{k!} + occ) search costs, where m is the length of the pattern, n is the length of the reference, and k is the number of tolerated mismatches (and insertion and deletions).


2019 ◽  
Vol 30 (04) ◽  
pp. 571-588
Author(s):  
Zifeng Xu ◽  
Fucai Zhou ◽  
Yuxi Li ◽  
Jian Xu ◽  
Qiang Wang

Graph data structure has been widely used across many application areas, such as web data, social network, and cheminformatics. The main benefit of storing data as graphs is there exists a rich set of graph algorithms and operations that can be used to solve various computing problems, including pattern matching, data mining, and image processing. Among these graph algorithms, the subgraph isomorphism problem is one of the most fundamental algorithms that can be utilized by many higher level applications. The subgraph isomorphism problem is defined as, given two graphs [Formula: see text] and [Formula: see text], whether [Formula: see text] contains a subgraph that is isomorphic to [Formula: see text]. In this paper, we consider a special case of the subgraph isomorphism problem called the subgraph matching problem, which tests whether [Formula: see text] is a subgraph of [Formula: see text]. We propose a protocol that solve the subgraph matching problem in a privacy-preserving manner. The protocol allows two parties to jointly compute whether one graph is a subgraph of the other, while protecting the private information about the input graphs. The protocol is secure under the semi-honest setting, where each party performs the protocol faithfully.


2020 ◽  
pp. 116-121
Author(s):  
Armen Kostanyan

The string matching problem (that is, the problem of finding all occurrences of a pattern in the text) is one of the well-known problems in symbolic computations with applications in many areas of artificial intelligence. The most famous algorithms for solving it are the finite state machine method and the Knuth-Morris-Pratt algorithm (KMP). In this paper, we consider the problem of finding all occurrences of a fuzzy pattern in the text. Such a pattern is defined as a sequence of fuzzy properties of text characters. To construct a solution to this problem, we introduce a two-dimensional prefix table, which is a generalization of the one-dimensional prefix array used in the KMP algorithm.


2021 ◽  
Vol 136 (3) ◽  
pp. 791-812
Author(s):  
Peder A. Tyvand ◽  
Jonas Kristiansen Nøland

AbstractThe onset of thermal convection in two-dimensional porous cavities heated from below is studied theoretically. An open (constant-pressure) boundary is assumed, with zero perturbation temperature (thermally conducting). The resulting eigenvalue problem is a full fourth-order problem without degeneracies. Numerical results are presented for rectangular and elliptical cavities, with the circle as a special case. The analytical solution for an upright rectangle confirms the numerical results. Streamlines penetrating the open cavities are plotted, together with the isotherms for the associated closed thermal cells. Isobars forming pressure cells are depicted for the perturbation pressure. The critical Rayleigh number is calculated as a function of geometric parameters, including the tilt angle of the rectangle and ellipse. An improved physical scaling of the Darcy–Bénard problem is suggested. Its significance is indicated by the ratio of maximal vertical velocity to maximal temperature perturbation.


2021 ◽  
Vol 2021 (3) ◽  
Author(s):  
Nishant Gupta ◽  
Nemani V. Suryanarayana

Abstract We construct classical theories for scalar fields in arbitrary Carroll spacetimes that are invariant under Carrollian diffeomorphisms and Weyl transformations. When the local symmetries are gauge fixed these theories become Carrollian conformal field theories. We show that generically there are at least two types of such theories: one in which only time derivatives of the fields appear and the other in which both space and time derivatives appear. A classification of such scalar field theories in three (and higher) dimensions up to two derivative order is provided. We show that only a special case of our theories arises in the ultra-relativistic limit of a covariant parent theory.


Sign in / Sign up

Export Citation Format

Share Document