# An Implementation of a Backtracking Algorithm for the Turnpike Problem in Membranes

[maalbores, rbjuayong, hnadorna]@up.edu.ph ABSTRACT

The goal of the Turnpike Problem is to reconstruct those point sets that arise from a given distance multiset. Although the Turnpike Problem itself is of unknown complexity, variants of it have been proven to be NP-complete, and there are no existing polynomial algorithms for it. P systems with active membranes and P systems with membrane creation are parallel computing models based on the characteristics of living cells; both have been used to solve NPcomplete problems in polynomial time or better by trading time for an exponential workspace. In this paper we present a P system with active membranes and membrane creation that implements an O(2n n log n)-time backtracking algorithm for the Turnpike Problem in linear time. multiset; according to [9], when these point sets are unique (that is, none of them is a reﬂection of another), they are called homometric sets. TP ﬁrst appeared in the 1930’s as a problem in X-ray crystallography, and reappeared in DNA sequencing as the Partial Digest Problem (PDP). The exact computational complexity of TP remains an open problem, although certain variants of it, as well as the decision problem of whether n points in R realize a multiset of n distances, have been proven to be NP-complete 2 in [9]. (Similarly, PDP’s own computational complexity is an open problem; variants of it are proven to be NP-hard or NP-complete in [2].) However, no polynomial-time algorithm has been found that solves TP. Among the algorithms that have been proposed is a polynomial factorization algorithm presented by Rosenblatt and Seymour in [8], and a backtracking algorithm presented by Skiena et al in [9]. The polynomial factorization algorithm relies on a polynomial representation of the distance multiset, and is chieﬂy concerned with ﬁnding that polynomial’s set of irreducible factors; the n-point sets arise from certain subsets of the irreducible factors. The algorithm runs in pseudopolynomial time. The backtracking algorithm, on the other hand, takes a more intuitive approach—it successively places each distance on a line and checks if the point arising from the placement is correct. The point is assumed to be one of the endpoints of the distance. Once all distances have been correctly placed, the resulting point set is a solution to the distance multiset. Skiena et al report in [9] that, although their algorithm runs in O(2n n log n) time, its average-case running time is polynomial; however, a series of instances for which the algorithm always performs in the worst case are presented in [10]. The simplicity of the backtracking algorithm has made it our algorithm of choice for implementation on P systems. In the succeeding sections we present a more detailed discussion of how the algorithm works (along with a small example), an overview of P systems, and the P system we formulated to solve TP.

1. INTRODUCTION

Suppose you are driving to a relative’s house in another province, and you must pass through a number of toll gates to get from your house to her house. You know the distances between each toll gate to every other toll gate, but you do not know the locations of the toll gates. Moreover, you do not know which pairs of toll gates correspond to which distances—i.e., you know that there is a toll gate on either end of each distance, but not which one. The problem of ﬁnding the locations of the toll gates is known as the Turnpike Problem (or TP). Formally, TP is deﬁned as follows: given a multiset of k distances, construct all n-point sets such that in any point set, every pair of points corresponds to the endpoints of a certain distance from the given multiset. Thus, if we have k distances, we expect...

Please join StudyMode to read the full document