Solving HPP and SAT by P Systems with Active Membranes and Separation Rules

Similar documents
Solving Multidimensional 0-1 Knapsack Problem by P Systems with Input and Active Membranes

Tissue P Systems with Cell Division

Complexity Classes in Membrane Computing

On P Systems with Active Membranes

Solving Vertex Cover Problem by Tissue P Systems with Cell Division

P systems based on tag operations

P Systems with Symport/Antiport of Rules

A Framework for Complexity Classes in Membrane Computing

Solving Subset Sum Problems by Time-free Spiking Neural P Systems

Solving the N-Queens Puzzle with P Systems

Natural Computing Modelling of the Polynomial Space Turing Machines

Cell-like Versus Tissue-like P Systems by Means of Sevilla Carpets

MINIMAL INGREDIENTS FOR TURING COMPLETENESS IN MEMBRANE COMPUTING

Extended Spiking Neural P Systems

Active membrane systems without charges and using only symmetric elementary division characterise P

Provable intractability. NP-completeness. Decision problems. P problems. Algorithms. Two causes of intractability:

A Model for Molecular Computing: Membrane Systems

On Controlled P Systems

Further Open Problems in Membrane Computing

An Approach to Computational Complexity in Membrane Computing

Spiking Neural P Systems with Anti-Spikes as Transducers

Minimal Cooperation in Symport/Antiport Tissue P Systems

Further Twenty Six Open Problems in Membrane Computing

Solving Problem of Graph Isomorphism by Membrane-Quantum Hybrid Model

On String Languages Generated by Numerical P Systems

Modeling Neural Processes in Lindenmayer Systems

Membrane Division, Oracles, and the Counting Hierarchy

Time and Synchronization in Membrane Systems

Automata Theory CS S-18 Complexity Theory II: Class NP

An Optimal Frontier of the Efficiency of Tissue P Systems with Cell Division

The Maze Generation Problem is NP-complete

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

Automata Theory CS Complexity Theory I: Polynomial Time

A Tissue P Systems Based Uniform Solution To Tripartite Matching Problem

Hybrid Transition Modes in (Tissue) P Systems

Solving NP-complete Problems by Spiking Neural P Systems with Budding Rules

Orientations of digraphs almost preserving diameter

About the Efficiency of Spiking Neural P Systems

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010

Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 20, 2009 Final versions: June 18, 2009

P Finite Automata and Regular Languages over Countably Infinite Alphabets

Review of unsolvability

Show that the following problems are NP-complete

On Communication Complexity in Evolution-Communication P Systems

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

Asynchronous Spiking Neural P Systems

Toda s Theorem: PH P #P

NP-completeness. Chapter 34. Sergey Bereg

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

On Flip-Flop Membrane Systems with Proteins

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Section 3.1. ; X = (0, 1]. (i) f : R R R, f (x, y) = x y

Solving Problems in a Distributed Way in Membrane Computing: dp Systems

On Two Families of Multiset Tree Automata

Spiking Neural P Systems with Astrocyte-Like Control 1

Membrane Computing and Economics: Numerical P Systems

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Graduate Algorithms CS F-21 NP & Approximation Algorithms

How Many Holes Can an Unbordered Partial Word Contain?

3130CIT Theory of Computation

Theory of Computation Time Complexity

Lecture 18: P & NP. Revised, May 1, CLRS, pp

Hamiltonicity and Fault Tolerance

Week 3 September 5-7.

COSC 594 Final Presentation Membrane Systems/ P Systems

Distance Coloring. Alexa Sharp. Cornell University, Ithaca, NY

Principles of Knowledge Representation and Reasoning

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition.

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

Lecture 15 - NP Completeness 1

Easy Shortcut Definitions

8.1 Exponents and Roots

Design and Analysis of Algorithms

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Lecture 4 : Quest for Structure in Counting Problems

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011

P Colonies with a Bounded Number of Cells and Programs

Space Complexity. Master Informatique. Université Paris 5 René Descartes. Master Info. Complexity Space 1/26

The Complexity of Maximum. Matroid-Greedoid Intersection and. Weighted Greedoid Maximization

More Completeness, conp, FNP,etc. CS254 Chris Pollett Oct 30, 2006.

Umans Complexity Theory Lectures

COMPUTATIONAL COMPLEXITY

6.5.3 An NP-complete domino game

Computing Using Signals: From Cells to P Systems

Minimal reductions of monomial ideals

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

SAT, NP, NP-Completeness

1.1 P, NP, and NP-complete

Characterizations of Catalytic Membrane Computing Systems

Timed Watson-Crick Online Tessellation Automaton

On small universal antiport P systems

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Comp487/587 - Boolean Formulas

Lecture 8: Complete Problems for Other Complexity Classes

Two NP-hard Interchangeable Terminal Problems*

COMP Analysis of Algorithms & Data Structures

A Note on the Probabilistic Evolution for P Systems

Transcription:

Solving HPP and SAT b P Sstems with Active Membranes and Separation Rules Linqiang PAN 1,3, Artiom ALHAZOV,3 1 Department of Control Science and Engineering Huahong Universit of Science and Technolog Wuhan 4374, Hubei, People s Republic of China E-mail: lqpan@mail.hust.edu.cn Institute of Mathematics and Computer Science Academ of Science of Moldova Str. Academiei 5, Chişinău, MD 8, Moldova E-mail: artiom@math.md 3 Research Group on Mathematical Linguistics Rovira i Virgili Universit Pl. Imperial Tàrraco 1, 435 Tarragona, Spain E-mail: {lp@fll, artiome.alhaov@estudiants}.urv.es Abstract. The P sstems (or membrane sstems) are a class of distributed parallel computing devices of a biochemical tpe, where membrane division is the frequentl investigated wa for obtaining an exponential working space in a linear time, and on this basis solving hard problems, tpicall NP-complete problems, in polnomial (often, linear) time. In this paper, using another wa to obtain exponential working space membrane separation, it was shown that Satisfiabilit Problem and Hamiltonian Path Problem can be deterministicall solved in linear or polnomial time b a uniform famil of P sstems with separation rules, where separation rules are not changing labels, but polariations are used. Some related open problems are mentioned. 1 Introduction P sstems (or membrane sstems) are biologicall motivated theoretical models of distributed parallel computing, introduced in [9], which can be seen as a general computing architecture where various tpes of objects can be processed b various operations. The area starts from the observation that certain processes which take place in the complex structure of living organisms can be considered as computations. For a motivation and detailed description of various P sstem models we refer to [9, 11]. 1

Basicall, P sstems with active membranes are the multiset-rewriting sstems, distributed within a tree-like membrane structure. The computation of P sstems (with smbol-objects) is the evolution of multisets (objects with associated multiplicities). The process continues until the sstem halts (no rules are applicable). The region outside the membrane sstem is called the environment; the outermost membrane is called the skin, and an membrane not containing other membranes is called elementar. With a halting computation a result is associated, in the form of the multiplicit of objects placed in a specified membrane (internal output) or sent out of the sstem during the computation (external output). This paper addresses decision problems, a P sstem is used in the accepting mode: an encoding of the problem is introduced in the initial configuration, and the computation stops b sending to the environment either an object es or an object no, depending on whether or not the problem has a positive or a negative answer, respectivel. We refer to [11] for more details. In membrane computing, membrane division inspired from cell division well-known in biolog is the frequentl investigated wa for obtaining an exponential working space in a linear time, and on this basis solving hard problems, tpicall NP-complete problems, in polnomial (often, linear) time. Details can be found in [1, 11, 13]. Recentl, PSPACEcomplete problems were also attacked in this wa (see [1, 16]). Membrane separation is also a well known phenomenon of cell biolog. Man macromolecules are too large to be transported through membranes b means of vesicle formation. This process can transport packages of chemicals out of the cell. Membrane separation, as another wa to obtain an exponential working space in a linear time, is alread introduced to membrane computing [4, 6]. With the price of label changing, one shows that SAT can be solved in linear time b a semi-uniform, even uniform famil of P sstems with separation rules without polariation, but in a confluent wa [4, 6]. Label changing is a powerful control feature. P sstems with active membranes (in the case of membrane division, instead of membrane separation) and label changing without

polariations were considered in [, 3], their computing power and efficienc in solving computationall hard problems in a feasible time were investigated. In this paper, polariation is revisited, P sstems with separation rules and polariations without such feature as label changing are considered. In the algorithm for deciding Satisfiabilit Problem (in short, SAT) b P sstems with division rules (Theorem 7.. in [11]), three polariations are used. Here we show that, in the case of separation rules, onl two polariations are needed to deterministicall decide SAT in linear time b a uniform famil of P sstems with rules of tpes (a), (c), (h) (for the tpes of rules, see Section ). It is worth mentioning that in our algorithm the communication rules of tpe (b) sending objects into membranes are not used. In [8, 11], it was shown that Hamiltonian Path Problem (in short, HPP) can be solved in polnomial time with respect to the number of nodes of the graph b P sstems with rules of tpes (a), (b), (c), and (e) in a semi-uniform wa. It remains open how to solve HPP in polnomial time b a uniform famil of P sstems with rules of tpes (a), (b), (c), and (e). In this paper, we present an algorithm for deterministicall deciding HPP in polnomial time b a uniform famil of P sstems with separation rules, where the communication rules of tpe (b) sending objects into membranes are not used. Prerequisities The reader is assumed to be familiar with basic elements of complexit theor and formal language theor, for instance, from [7, 14, 15], as well as with the basic knowledge of membrane computing, for instance, from [11] (details and recent results from membrane computing can be found at the web address http://psstems.disco.unimib.it), in particular, with P sstems with active membranes. For an alphabet V, b V we denote the free monoid generated b V under the operation of concatenation; the empt string is denoted b λ, and V \ {λ} is denoted b V +. B N we denote the set of positive integers, and N := N {} is the set of non-negative 3

integers. Let U be an arbitrar set, a multiset (over U) is a mapping M : U N ; M(a), for a U, is the multiplicit of a in the multiset M. We indicate this fact also b in the form (a, M(a)). If the set U is finite, a multiset M over U, {(a 1, M(a 1 ),, (a n, M(a n )}, can also be represented b a string: w = a M(a 1) 1 a M(an) n. In the following we will not distinguish the representations of multiset b a mapping or b a string. For the sake of completeness, we recall the definition of P sstems with active membranes. Here onl part of rules are recalled; and the membranes are allowed to have charges, and possibl change charges. A P sstem with active membranes (and electrical charges) is a construct Π = (O, H, µ, w 1,..., w m, R), where: 1. m 1 (the initial degree of the sstem);. O is the alphabet of objects; 3. H is a finite set of labels for membranes; 4. µ is a membrane structure, consisting of m membranes, labeled (not necessaril in a one-to-one manner) with elements of H; 5. w 1,..., w m are strings over O, describing the multisets of objects (ever smbol in a string representing one cop of the corresponding object) placed in the m regions of µ; 6. R is a finite set of developmental rules, of the following forms: (a) [ a v] e h, for h H, e {+,, }, a O, v O (object evolution rules, associated with membranes and depending on the label and the charge of the membranes, but not directl involving the membranes, in the sense that the membranes are neither taking part in the application of these rules nor are the modified b them); 4

(b) a[ ] e 1 h [ b ]e h, for h H, e 1, e E, a, b O (communication rules, sending an object into a membrane, possibl changing the polariation of the membrane, but not its label). (c) [ a ] e 1 h [ ] e h b, for h H, e 1, e {+,, }, a, b O (communication rules; an object is sent out of the membrane, possibl modified during this process; also the polariation of the membrane can be modified, but not its label); (e) [ a ] e 1 h [ b ]e h [ c ]e 3 h, for h H, e 1, e, e 3 {+,, }, a, b, c O (division rules for elementar membranes; in reaction with an object, the membrane is divided into two membranes with the same label, possibl of different polariations; the object specified in the rule is replaced in the two new membranes b possibl new objects, and the remaining objects are duplicated); (h) [ O] e 1 h [ O 1] e h [ O ] e 3 h [ O n] en h, for h H, e 1, e,, e n {+,, }, O = O 1 O n, O i O j =, 1 i j n, n (d-separation rules for elementar membranes, with respect to a given set of objects; the membrane is separated into some new membranes with the same labels, possibl of different polariations; the objects from each set of the partition of the set O are placed in the corresponding membrane. The case when the membrane is separated to two membranes is called -separation). The rules of tpe (h) are generaliation of rule (h ) in [4], which is -separation without polariation. (Note that, in order to simplif the writing, in contrast to the stle customar in the literature, we have omitted the label of the left parenthesis from a pair of parentheses which identifies a membrane.) The rules of tpe (a) are applied in the parallel wa (all objects which can evolve b such a rule should do it), while the rules of tpes (b), (c), (e), (h) are used sequentiall, in the sense that one membrane can be used b at most one rule of these tpes at a time. In 5

total, the rules are used in the non-deterministic maximall parallel manner: all objects and all membranes which can evolve, should evolve. Onl halting computations give a result, non-halting computations give no output. A P sstem is called deterministic if there is a single computation. A P sstem is called confluent if either all of its computations do not halt, or all of its computations reach the same halting configuration. To understand what it means solving a problem in a semi-uniform/uniform wa, here we briefl recall some related notions. Consider a decisional problem X. A famil Π X = (Π X (1), Π X (), ) of P sstems (with active membranes in our case) is called semiuniform (uniform) if its elements are constructible in polnomial time starting from X(n) (from n, respectivel), where X(n) denotes the instance of sie n of X. We sa that X can be solved in polnomial (linear) time b the famil Π X if the sstem Π X (n) will alwas stop in a polnomial (linear, respectivel) number of steps, sending out the object es if and onl if the instance X(n) has a positive answer. For more detailed information about complexit classes for P sstems, please refer to [11, 1]. 3 Solving SAT b P Sstems with Separation Rules and Two Polariations The SAT problem (satisfiabilit of propositional formulae in the conjunctive normal form) is probabl the best known NP-complete problem [5], which asks whether or not for a given formula in the conjunctive normal form there is a truth-assignment of variables such that the formula assumes the value true. The following theorem shows that the SAT problem can be solved in linear time b a uniform famil of P sstems with separation rules, and here onl two polariations are used (without loss of generalit, neutral and positive charge are used). Theorem 3.1 SAT can be deterministicall solved b a uniform famil of P sstems with two polariations and rules of tpes (a), (c), (h) (-separation onl) in linear time with 6

respect to the number of variables and the number of clauses. Proof. Let us consider a propositional formula in the conjunctive normal form: β = C 1 C m, C i = i,1 i,li, 1 i m, where i,k {x j, x j 1 j n}, 1 i m, 1 k l i. The instance β of SAT (to which the sie (m, n) is associated) is encoded as a multiset over V (n, m) = {x i,j,j, x i,j,j 1 i m, 1 j n}. The object x i,j,j represents the variable x j appearing in the clause C i without negation, and object x i,j,j represents the variable x j appearing in the clause C i with negation. Thus, the input multiset is w = {x i,j,j x j { i,k 1 k l i }, 1 i m, 1 j n} { x i,j,j x j { i,k 1 k l i }, 1 i m, 1 j n}. For given (n, m) N, we construct a recogniing P sstem (Π(n, m), V (n, m), i ) with 7

input membrane i =, where Π(n, m) = (O(n, m), H, µ, w, w 1, w s, R), O(n, m) = {x i,t,j, x i,t,j, 1 i m, 1 j n, t j} {x i,t,j, x i,t,j, 1 i m, 1 j n, t j 1} {c i,j 1 i m, 1 j n + 1} {c i,j 1 i m, 1 j n} {d i i n + m + 4} {d i 1 i n + 1} {e i i m} {s, es, no}, H = {1, }, µ = [ [ ] ] 1, w 1 = d, w = d, and R contains of the following rules (we also give explanations about the use of these rules): 1. [ O] [ O 1] [ O O 1], O 1 = {x i,t,j, x i,t,j 1 i m, 1 j n, t j 1} {c i,j 1 i m, 1 j n} {d i 1 i n + 1}.. [ x i,t,j x i,t 1,j x i,t 1,j ], [ x i,t,j x i,t 1,j x i,j 1,j ], [ x i,t,j x i,t 1,jx i,t 1,j ], [ x i,t,j x i,t 1,j x i,t 1,j ], 1 i m, 1 t j, 1 j n. 3. [ x i,,j c i,j c i,j ], [ x i,,j λ], 8

[ x i,,j c i,jc i,j ], [ x i,,j λ], 1 i m, 1 j n. 4. [ c i,j c i,j+1 c i,j+1 ], [ c i,j c i,j+1c i,j+1 ], 1 i m, 1 j n 1. 5. [ c i,n c i,n+1 ], [ c i,n c i,n+1], 1 i m. 6. [ d i d i+1 d i+1 ], i n. [ d i d i+1d i+1 ], 1 i n. [ d n+1 d n+ e s]. [ d n+1 d n+e s]. In n + 1 steps, b the rules of tpes (1) (4), n membranes with label are created, corresponding to the all possible n truth assignments of the variables x 1, x,..., x n. During this process, ever object x i,j,j of the input evolves to x i,,j and x i,,j in j steps. Then, the evolve to c i,j in membranes where true value was chosen for x j (recall that x i,j,j = true satisfies clause C i ) and are erased in membranes where false value was chosen for x j. In the next n j steps, c i,j evolves to c i,n or c i,n. It takes one more step c i,n and c i,n evolve to c i,n+1 b the rules of tpe (5), which means the sstem is read for checking whether or not there is at least one membrane with label which contains all smbols c 1,n+1,, c m,n+1 (if it is the case, that means the truth-assignment from that membrane satisfies all clauses, hence it satisfies formula β; otherwise, the formula β is not satisfiable) (checking phase is done b the rules of tpes (7) and (8)). Similarl, x i,j,j changes to c i,n+1 if x j = false and is erased if x j = true. Note that at step n +, each membrane with label has the objects d n+, e and s. 7. [ c 1,n+1 ] [ ]+ c 1,n+1. For all n membranes with label, we check whether or not c 1,n+1 is present in each 9

membrane. If this is the case, then c 1,n+1 is sent out of the membrane where it is present, changing in this wa the polariation of that membrane, to positive. The membranes which do not contain the object c 1,n+1 remain neutrall charged and the will no longer evolve, as no further rule can be applied to them. 8. [ c i,n+1 c i 1,n+1 ] +, 1 i m. [ e i e i+1 ] +, i m 1. [ d i d i+1 s] +, n + i n + m. [ s] + [ ] s. In the copies of membranes with positive polariation, hence onl those where we have found c 1,n+1 in the previous step, the following operations are done in parallel. The subscript of e i denoting the number of satisfied clauses is increased, and the first subscripts of all objects c i,n+1 from that membrane are decreased. The copies of c 1,n+1 in the membranes with positive polariation evolve to c,n+1, which will never evolve again. If the second clause was satisfied b the truth-assignment from a membrane, that is object c,n+1 was present in a membrane, then the object c,n+1 evolve to c 1,n+1, hence the rule of tpe (7) can be applied again. Note that evolving from c,n+1 to c 1,n+1 is possible onl in membranes where we alread had c 1,n+1, hence we check whether the second clause is satisfied onl after the first clause was satisfied. The object d i evolves to d i+1 s, introducing the auxiliar object s. At the same time, the auxiliar object s (first cop of s is alread introduced b the rules of tpes (6)) exits the membrane with positive charge, returning the polariation of the membrane to neutral, which makes possible the use of rules of tpe (7). The rules of tpe (7) and (8) are applied as man times as possible (in one step the rules of tpe (7), in next step the rules of tpe (8), and then repeat the ccle). Clearl, if a membrane does not contain an object c i,n+1, then that membrane will stop evolving at the time when the first subscript of c i,n+1 is supposed to reach 1. In this wa, after m steps, onl membranes which contains all objects c 1,n+1, c,n+1,, c m,n+1 1

will get the object e m. Note that at that moment the corresponding membranes have neutral charge. 9. [ e m ] [ ] es. [ es] 1 [ ]+ 1 es. The object e m exits the membrane where the truth-assignment satisfies formula β, producing the object es. This object is then sent to the environment, telling us that the formula is satisfiable, and the computation stops, which is the n + m + 4th step of the computation. The application of the second rule of tpe (9) changes the polariation of the skin membrane to positive in order that the objects es remaining in it are not able to continue exiting the skin membrane. 1. [ d i d i+1 ] 1, i n + m + 3. [ d n+m+4 ] 1 [ ] 1 no. B the rules of tpe (1), the objects d i in the skin membrane evolve onl when the skin membrane has neutral charge. Especiall, object d n+m+4 can evolve sending out to the environment an object no onl when the formula is not satisfiable (otherwise, the object es alread changed the polariation of the skin membrane to positive in the previous step, object d n+m+4 cannot evolve). From the previous explanation of the use of rules, one can easil see how this P sstem works. It is clear that the object es is sent to the environment if and onl if the formula β is satisfiable. This is achieved in n + m + 4 steps: in n steps we create n internal membranes (as well as the n different truth-assignments), then steps for snchroniation; it takes m steps to check whether all clauses are satisfied b an assignment; further steps are necessar to output the computing result es. If formula β is not satisfiable, then at step n + m + 5 the sstem sends the object no to the environment. Therefore, the famil of membrane sstems we have constructed is sound, and linearl efficient. To prove that the famil is uniform, we have to show that for a given sie, the con- 11

struction of P sstems described in the proof can be done in polnomial time b a Turing machine. We omit the detailed construction due to the fact that it is straightforward but cumbersome as explained in the proof of Theorem 7..3 in [11] (although P sstems in [11] are semi-uniform). So SAT problem can be decided in linear time (n + m + 5) b recogniing active P sstems with separation rule in a uniform wa, and this concludes the proof. 4 Solving HPP b P Sstems with Separation Rules The Hamiltonian Path Problem (HPP in short) is a well-known NP-complete problem [5], which asks whether or not a given graph G = (V, E) (here we consider directed graphs) contains a Hamiltonian path, that is a path which visits all nodes from G exactl once. Here we consider the variant in which the starting vertex and ending vertex of a path are specified. From the above Theorem 3.1 and the fact that SAT is NP-complete, it follows that HPP can also be deterministicall solved b a uniform famil of P sstems with rules of tpes (a), (c), and (h) in polnomial time. One can get this kind of solution b the reduction of HPP to SAT in order to appl those P sstems which solve SAT in a linear time. But it still remains open how one can reduce an NP problem to another NP-complete problem b P sstems. So we are here interested in direct solutions to HPP, avoiding the reduction to SAT. Theorem 4.1 A uniform famil of P sstems with rules of tpes (a), (c), and (h) (here d-separation) can deterministicall solve HPP in polnomial time. Proof. Let G = (V, E) be a graph with n vertices and m edges, V = {v 1,, v v }, E = {e 1,, e m }, with specified starting vertex v 1 and ending vertex v n. The instance G (to which the sie (m, n) is associated) is encoded as a multiset over Σ( n, m ) = {x i,j,i 1 i n, 1 j n}. 1

The object x i,j,i represents there is an edge from the vertex v i to the vertex v j. Thus, the input multiset is w = {x i,j,i v i v j E, 1 i n, 1 j n}. For given (n, m) N, we construct a recogniing P sstem (Π( n, m ), Σ( n, m ), i ) with input membrane i =, where Π( n, m ) = (O( n, m ), H, µ, w 1, w, R), O( n, m ) = {x i,j,k 1 i, j n, 1 k n} { i,j,k, i,j,k 1 i, j, k n} {c i,j 1 i, j n} {c i,j,k 1 i, j n, k n} {d i,j,k 1 i, j n 1, 1 k n} {f i i n + 6n + } {d, s, es, no}, H = {1, }, µ = [ [ ] ] 1, w 1 = f, w = c 1,1, and the set R contains the following rules (we also give explanations about the use of these rules during the computations): 1. [ c i,j c i,j,i dd], 1 i, j n 1. [ c n,n ] [ ] es. In the membrane with label, when it is electricall negative, the object c i,j evolves to c i,j,i dd. The auxiliar object d is used to change the polariation of the membrane with label from positive to negative or from negative to positive (the rules of tpe ()). The first subscript i of object c i,j and object c i,j,i represents the vertex v i, the second subscript j of object c i,j and object c i,j,i represents the number of vertices which the current path contains, the third subscript of c i,j,i is used as a counter. The presence of the object c n,n in the membranes with label and negative charge means that there is a Hamiltonian path in the graph G; the object es will be sent to the skin membrane, and then to the environment (the rule of tpe (9)). 13

. [ d] [ ]+ d. [ d] + [ ] d. 3. [ c i,j,k c i,j,k 1 dd] +, 1 i, j n 1, k i. [ c i,j,1 c i,j, s] +, 1 i, j n 1. In the membrane with label, when it is electricall positive, the object c i,j,k (k ) evolves to c i,j,k 1 dd, or the object c i,j,1 evolves to c i,j, s. The auxiliar object s is used to change the polariation of membrane from negative to neutral (the first rule of tpe (4)), so that membrane separations can take place (the rules of tpe (7)). 4. [ s] [ ] s. [ s] [ ] s. 5. [ x i,j,k x i,j,k 1 ] +, 1 i, j n, k. The rules of tpe (5) are designed to check the initial vertices of the edges. When the membranes with label have positive charge, the third subscripts of the objects x i,j,k are reduced b 1. Here, the appearance of the objects x i,j, 1 is possible. In each membrane with label, when the object c i,j, appears, the objects whose third subscripts are represent the edges whose initial vertices are v i. 6. [ x i,j,k i,j,1 i,j,n ], 1 i, j n, k. [ x i,j, i,j,1 i,j,n ], 1 i, j n. [ c i,j, d i,j,1 d i,j,n ], 1 i, j n 1. When the membranes with label have neutral polariation, the objects x i,j,, x i,j,k (k ), and c i,j, respectivel evolve to i,j,1 i,j,n, i,j,1 i,j,n, and d i,j,1 d i,j,n. The object i,j,k represents that there is an edge from v i to v j, and the next possible vertices which will be added to the current path (alread from v 1 to v j ) are the vertices which can be reached from v k. So onl objects i,j,j work for extending the current path. At the same time, b the rules of tpe (7), each of these membranes 14

separates into n membranes. 7. [ O] [ O 1] [ O ] [ O n], O t = { i,j,t, i,j,t 1 i, j n} {d i,j,t 1 i, j n 1}, 1 t n. 8. [ i,j,j s], 1 i, j n. [ d i,j,k c k,j+1 ], 1 i, j n 1, 1 k n. [ i,j,k x i,j,i ], 1 i, j, k n. [ i,j,k λ], 1 i, j, k n, j k. If the object i,j,j appear in a membrane with label, it will evolve to the object s, and then in the next step the auxiliar object s will change the charge of that membrane from neutral to negative (the second rule of tpe (4)), so that the objects i,j,k can return to x i,j,i and above described process of extending the current path can ccle. The other objects i,j,k (j k) will disappear. The objects d i,j,k evolve to c k,j+1, where k denotes the next possible vertex v k which can be added to the current path. 9. [ es] 1 [ ]+ 1 es. The presence of the object c n,n in the membranes with label and negative charge shows that there exists a Hamiltonian path in the graph G. The second rule of tpe (1) sends to the skin membrane the object es, then the rule of tpe (9) sends it out of the sstem, telling us the positive answer. Note that the rule of tpe (9) changes the polariation of the skin membrane to positive in order that the objects (if exists) remaining in it cannot continue exiting the skin membrane. 1. [ f i f i+1 ] 1, i n + 6n + 1. [ f n +6n+] 1 [ ] 1 no. If there is no Hamiltonian path in the graph G, then at step n + 6n + the polariation of the skin membrane remains neutral, and the skin membrane has 15

the object f n +6n+, originating from f. In the next step, the object f n +6n+ produces the object no, which is sent to the environment, telling us that there is no Hamiltonian path in the graph G, and the computation stops. From the previous explanation of the use of rules, one can easil see how this P sstem works (see also the following example). It is clear that the computation is deterministic, and the object es is sent to the environment if and onl if there exists a Hamiltonian path in the graph G. This is achieved in not more than n + 6n + steps: for each ccle of extending the current path, it takes not more than n + 6 steps, and there are at most n ccles; further steps are necessar to output the computing result es (note that after the object es appears in the environment, telling us there is a Hamiltonian path in G, some of the internal membranes ma continue evolving, but in total the computation will stop in not more than n + 6n + steps). If there is no Hamiltonian path in the graph G, then at step n + 6n + 3 the sstem sends the object no to the environment. Therefore, the famil of membrane sstems we have constructed is sound, and linearl efficient. To prove that the famil is uniform, we have to show that for a given sie, the construction of P sstems described in the proof can be done in polnomial time b a Turing machine. We omit the detailed construction due to the fact that it is straightforward but cumbersome as explained in the proof of Theorem 7..3 in [11] (although P sstems in [11] are semi-uniform). So HPP problem was decided in polnomial time (O(n )) b recogniing active P sstems with separation rule in a deterministic and uniform wa, and this concludes the proof. We illustrate the previous construction and the work of the sstem b the following example, where the instance graph G has four vertices with starting vertex v 1 and ending vertex v 4. In this example, G has a Hamiltonian path, the object es will appear in the environment. 16

v 1 v v 3 v 4 c 1,1 x 1,,1 x 1,3,1 Figure 1. An instance of HPP with four vertices. c 1,1,1 d d c 1,1,1 d = x 1,,1 x 1,3,1 = x 1,,1 x 1,3,1 + = x,3, x,4, x 3,4,3 x,3, x,4, x 3,4,3 x,3, x,4, x 3,4,3 f f 1 1 f 1 1 c 1,1, s x 1,, x 1,3, c 1,1, = x 1,, x 1,3, = x,3,1 x,4,1 x 3,4, x,3,1 x,4,1 x 3,4, f 3 f 1 4 1 1,,1 d 1,1, 1,, 1,,1 d 1,1, s 1,3,1,3,1 1,3,,3, 1,3,1,3,1 1,3,,3,,4,1 3,4,1,4, 3,4,,4,1 3,4,1 =,4, 3,4, = d 1,1,3 1,,3 d 1,1,4 1,,4 d 1,1,3 1,,3 d 1,1,4 1,,4 1,3,3,3,3 1,3,4,3,4 s,3,3 1,3,4,3,4,4,3 3,4,3,4,4 3,4,4 f 5,4,3 3,4,3,4,4 3,4,4 f 6 1 1,,1 d 1,1, 1,,1 c, 1,3,1,3,1 1,3,,3, 1,3,1,3,1 x,3, x,4,,4,1 3,4,1,4, 3,4,,4,1 3,4,1 x = 3,4,3 = d 1,1,3 1,,3 d 1,1,4 1,,4 c 3, d 1,1,4 1,,4,3,3 1,3,4,3,4 x,3, x,4, 1,3,4,3,4,4,3 3,4,3,4,4 3,4,4 x f 7 3,4,3,4,4 3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4 1,,4 + 1,,1 d 1,1,4 1,,4 1,3,1,3,1 1,3,4,3,4 1,3,1,3,1 1,3,4,3,4,4,1 3,4,1,4,4 3,4,4,4,1 3,4,1,4,4 3,4,4 d,,1,3,1 d,,,3, d,,1,3,1 d,,,3,,4,1 3,4,1,4, 3,4,,4,1 3,4,1,4, 3,4, d 3,,1 3,4,1 d 3,, 3,4, d 3,,1 3,4,1 d 3,, 3,4,,3,1,4,1,3,,4,,3,1,4,1,3,,4, d 3,,3 3,4,3 d 3,3,1 d 3,,3 3,4,3 d 3,3,1,3,3,4,3 3,4,1,3,3,4,3 3,4,1 d 3,3, 3,4, d 4,3,1 3,4,1 d 4,3,3 3,4,3 d 4,3,1 d 3,3,3 3,4,3 = d 4,3, 3,4, d 4,3,4 3,4,4 d 4,3,,3,1,3,,4,1,4, d 4,3,3 d 4,3,4,3,3,4,3,3,4,4,4 es d 3,3, 3,4, d 4,3,1 3,4,1 d 4,3,3 3,4,3 d 4,3,1,3,3,4,3,3,4,4,4 es f 31 1 d 3,3,3 3,4,3 d 4,3, 3,4, d 4,3,4 3,4,4 d 4,3,,3,1,3,,4,1,4, d 4,3,3 d 4,3,4 f 3 1 Figure. The configurations at each step of the computation. In the Theorem 4.1, d-separation is used, that is a membrane can be separated into more than two new membranes. Actuall, -separation is enough to deterministicall solve HPP in polnomial time. Theorem 4. A uniform famil of P sstems with rules of tpes (a), (c), and (h) (here -separation) can deterministicall solve HPP in polnomial time. It is not difficult to prove Theorem 4., based on the proof of Theorem 4.1. The same membrane structure as constructed in the proof of Theorem 4.1 can be used, the onl 3

difference is that more objects are needed, and some rules should be modified. Specificall, these objects { i,j,k, i,j,k 1 i, j n, k n 1} {d i,j,k 1 i, j n 1, k n 1} should be added to the alphabet of objects; and the rules of tpes (6) and (7) should be substituted b the following rules of tpes (6 ) and (7 ). 6. [ x i,j,k i,j,1 i,j, ], 1 i, j n, k. [ i,j,l i,j,l i,j,l+1 ], 1 i, j n, l n. [ i,j,n 1 i,j,n 1 i,j,n ], 1 i, j n. [ x i,j, i,j,1 i,j, ], 1 i, j n. [ i,j,l i,j,l i,j,l+1 ], 1 i, j n, l n. [ i,j,n 1 i,j,n 1 i,j,n ], 1 i, j n. [ c i,j, d i,j,1 d i,j, ], 1 i, j n 1. [ d i,j,l d i,j,ld i,j,l+1 ], 1 i, j n 1, l n. [ d i,j,n 1 d i,j,n 1d i,j,n ], 1 i, j n 1. 7. [ O] [ O k] [ O O k], O k = { i,j,k, i,j,k 1 i, j n} {d i,j,k 1 i, j n 1}, 1 k n 1. Clearl, the time of computation is also polnomial, i.e. O(n ). So we here omit the detailed proof of Theorem 4.. 5 Final Remark In this paper, membrane separation instead of membrane division is used to obtain an exponential working space in a linear time, on this basis SAT and HPP are solved in linear or polnomial time in a uniform and deterministic wa. In the membrane algorithm for SAT, two polariations are used, it remains open whether the polariations can be completel removed without adding new features such as label changing. Although a membrane algorithm with separation rules for HPP is given, and membrane division is the frequentl investigated wa for obtaining an exponential working space in 4

a linear time, it still remains open deterministicall solving HPP in polnomial time b P sstems with division rules instead of separation rules in a uniform wa. Acknowledgements. The first author is supported b grant DGU-SB1-9 from Spanish Ministr of Education, Culture, and Sport, National Natural Science Foundation of China (Grant No. 637389), and Huahong Universit of Science and Technolog Foundation. The second author acknowledges the Moldovan Research and Development Association (MRDA) and the U.S. Civilian Research and Development Foundation (CRDF), Award No. MM-334 for providing a challenging and fruitful framework for cooperation. References [1] A. Alhaov, C. Martín-Vide, L. Pan, Solving a PSPACE-Complete Problem b P Sstems with Restricted Active Membranes, Fundamenta Informaticae, 58, (3), 66 77. [] A. Alhaov, L. Pan, Polariationless P Sstems with Active Membranes, Grammars, 7, 1 (4), 141-159. [3] A. Alhaov, L. Pan, Gh. Păun, Trading Polariations for Labels in P Sstems with Active Membranes, Acta Informatica, 41(4), 111-144. [4] A. Alhaov, T.-O. Ishdorj, Membrane Operations in P Sstems with Active Membranes, In: Gh. Păun, A. Riscos-Núñe, A. Romero-Jiméne, F. Sancho-Capparini (eds.) Second Brainstorming Week on Membrane Computing, Sevilla, -7 Februar, 4, Research Group in Natural Computing TR 1/4, Universit of Sevilla, 37-44. [5] M. R. Gare, D. J. Johnson: Computers and Intractabilit. A Guide to the Theor of NP-Completeness. W. H. Freeman, San Francisco, 1979. [6] L. Pan, A. Alhaov, T.-O. Ishdorj, Further Remarks on P Sstems with Active Membranes, Separation, Merging and Release Rules, In: Gh. Păun, A. Riscos-Núñe, A. 5

Romero-Jiméne, F. Sancho-Capparini (eds.) Second Brainstorming Week on Membrane Computing, Sevilla, -7 Februar, 4, Research Group in Natural Computing TR 1/4, Universit of Sevilla, 316-34. Also in Soft Computing, 8(4), 1-5. [7] Ch. P. Papadimitriou, Computational Complexit, Addison-Wesle, Reading, MA, 1994. [8] A. Păun, On P Sstems with Membrane Division. In Unconventional Models of Computation (I. Antoniou, C.S. Calude, M.J. Dinneen, eds.) Springer, London,, 187-1. [9] Gh. Păun, Computing with Membranes, Journal of Computer and Sstem Sciences, 61, 1 (), 18 143, [1] Gh. Păun, P Sstems with Active Membranes: Attacking NP-Complete Problems, Journal of Automata, Languages and Combinatorics, 6, 1 (1), 75 9. [11] Gh. Păun, Computing with Membranes: An Introduction, Springer-Verlag, Berlin,. [1] M.J. Pére-Jiméne, A. Romero-Jiméne, F. Sancho-Caparrini, Complexit Classes in Models of Cellular Computation with Membranes, Natural Computing,, 3 (3), 65-85. [13] M.J. Pére-Jiméne, A. Romero-Jiméne, F. Sancho-Caparrini, Teoría de la Complejidad en Modelos de Computatión Celular con Membranas, Editorial Kronos, Sevilla,. [14] G. Roenberg, A. Salomaa, eds., Handbook of Formal Languages (3 volumes), Springer-Verlag, Berlin, 1997. [15] A. Salomaa, Formal Languages, Academic Press, New York, 1973. 6

[16] P. Sosík, Solving a PSPACE-Complete Problem b P Sstems with Active Membranes, Proceedings of the Brainstorming Week on Membrane Computing (M. Cavaliere, C. Martín-Vide, and Gh. Păun, eds.), Report GRLMC 6/3, 3, 35 31. 7