A P System for Solving All-Solutions of TSP

P system is a parallel computing system based on a membrane computing model. Since the calculation process of the P system has the characteristics of maximum parallelism and Non-determinism, it has been used to solve the NP-hard problem in polynomial time. This paper designs a P system for TSP problem solving. This P system can not only determine whether the TSP problem has solution, but also give the allsolution when the TSP problem is solved. Finally, an example is given to illustrate the feasibility and effectiveness of the P system designed in this paper. Keywords—P system, TSP, membrane computing, natural computing

are stored in membrane separated regions.Obviously, membrane algorithms don't conform to Gheorghe Pǎun's model of membrane computing too.
As a continuation of the research in [15], we have designed a P system to solve the TSP problem in this paper.The P system includes path construction, path detection, path comparison and path clipping, and its computational complexity is O(n 2 ).The rest part of this paper is as follows: section II briefly introduces cell-like P system.In Section III, we design a parallel computing method which is suitable for P system to solve TSP problem.Section IV proposes a P system to solve TSP.The P system's structure and evolution rules are given, and the computational complexity of the P system is analyzed.In Section V, we give an example to show the process of solving the TSP using the P system designed in this paper.The conclusion is drawn in the last section.

II. FOUNDATIONS
This paper is based on the cell-like P system.The cell-like P system is a class of the most basic P system, which consists of a series of membrane nesting, its structure shown in Fig.
1 [8].A P system consists of a membrane structure, objects and evolutionary rules.The membrane structure consists of a skin, multiple membranes and multiple elementary membranes (in the absence of confusion, said the membrane).The region outside the skin is called the environment, which provides computing objects for the P system.The calculation objects (typically represented by the multiset of objects) and the object evolution rules are stored in the inner region of each membrane.The evolutionary rules within the membrane follow the maximum parallelism and non-determinism to make the object multisets evolve.When there is no any object multiset in the P system can be evolved, we call the calculation of the P system is over, and the results (expressed as object multisets) of the calculation are stored in a specific membrane or environment.If the evolution of the P system never stops, we call the calculation failed and no calculation results.According to [16], [17], the cell-like P system can be formally described as (1). Where, ) O is the non-empty alphabet.∀o∈O is an object in Π. O * is the Kleene closure over O, ∀ω∈O * called an multiset in Π.Let λ is empty multiset, O + = O * − {λ}; 2) µ is the membrane structure of Π. µ has m membrane, and each membrane is marked with a unique label i (1 ≤ i ≤ m). 3) is the finite set of the evolution rules in membrane i of Π.
5) i o is the label of a membrane to store the calculation results.Especially, i o = 0 indicates that the output is stored in the environment of Π.
In Π, the maximal parallelism and Non-determinism of the rule execution mean: 1) Maximal parallelism: At any time, all rules can be executed must be performed at the same time.
2) Non-determinism: Suppose n rules are competing for execution, but P system can only support m (m < n) rule execution, then m rules are randomly selected from n rules to execute.

III. TSP AND THE PARALLEL ALGORITHM
TSP is a NP-hard problem in combinatorial optimization, which can be described as: Given an undirected weighted graph G = (V, E), where V is the vertex set and E is the edge set.For a given vertex v, find a path P that passes through all the other vertices once and only once and finally returns to the vertex v, and the sum of the weights on P (called the cost of P ) is the smallest.In other words, the TSP is to find the Hamiltonian cycles with the least cost in all Hamiltonian circles of G.
Fig. 2 shows an example of an undirected weighted graph G.With V 1 as the starting and ending vertex, then the Hamiltonian cycles of G includes and so on.As we can see from Fig. 2, the minimum cost cycle is the second Hamiltonian cycle, so the solution of travelling salesman problem for Fig. 2 is Output: the minimum cost cycle path or No; (1) Path construction: Construct all legal paths in parallel, all paths make up a multi-tree, the steps of constructing one legal path P as follows: 1) Add v0 to the path P as the common root node; 2) If there is edge e =< vi, vj >, vi is the last vertex of path P and vj ∈ P , then add e and vj to path P so that vj becomes the last vertex of P ; 3) Repeat step 2) until no vertex could be added to path P ; 4) If all the vertices in graph G have been added to path P and there is an edge connecting the last vertex of path P to v0,then add v0 to path P as the last vertex; (2) Path detection: Delete illegal Hamiltonian cycle paths while constructing the paths: 1) If there is any vertex that cannot be added to path P, delete path P ; 2) If the last vertex of path P is not v0, delete path P ; (3) Path comparison: Find a Hamiltonian cycle with minimum cost among all Hamiltonian cycles of G: 1) Starting from every leaf node to find the cost of every Hamiltonian cycle path; 2) If several paths share the common parent node, compare the cost of each path, find the path with minimum cost among them; 3) repeat 2) until the root node has been visited; (4) Path cutting: Delete paths that don't have the minimum weight; (5) Output: Output travelling salesman path or No.

End
In [15], a parallel algorithm PAHCP (Parallel algorithm for Hamiltonian cycle problem) is given to solve the all solution of the Hamiltonian problem.Based on the idea of PAHCP, a parallel algorithm PATSP (Parallel algorithm for TSP) for all solutions of TSP can be described as Table 1.

IV. DESIGN OF P SYSTEMS Π TSP
In this section, we have designed a P system Π TSP for solving TSP based on the algorithm which discussed in Section III.

A. The Definition of Π TSP
As the cell-like P system just normally defined by (1), we defined this cell-like P system Π TSP as follows: where,

1)
O is a finite and non-empty alphabet of objects, which includes: • Some normal objects: which indicate vertices in the undirected weighted graph: • Some special objects: -y, w, z: y indicates that all vertices have been visited; w, z means that Hamiltonian path has been found.
-δ: is an operation that means dissolving the current membrane to release the object to the outside of the membrane.
In addition, other objects in the system will be described when they are used.2) µ is the initial membrane structure of the system as shown in Fig. 3, which will change with the use of evolutionary rules.
3) ω={ω 1 ,ω 2 } is the multiset in the initial membrane structure of where n is the number of nodes in the graph, p io means the output path will start from the node i o (1≤i o ≤n), a i represent the vertices of graph, m and ζ are used to control the execution of the rules.ω 2 =λ.
4) R is the set of rules for system evolution, and where, R C is used for path construction, R D is used for path detection, R F if used for path comparison and R T is used for path cutting.Based on the Parallel algorithm PATSP, the procedure of applying the rules in Π TSP is: -path construction(see subsection B 1)).
In Π TSP , ∀ r ∈ R i has the following two forms: T ar = {here; out; in j |1 ≤ j ≤ m} and k ≥ 1.
(a) k indicates the priority, the smaller value k is set, the higher the priority of the corresponding rule is.High-priority rules will be executed before the lower-level rules.
(b) T ar identifies the location where the evolutionary results are stored.Here means v is remained in membrane i, out means v goes out of membrane i, and in j means v goes to inner membrane j.To simplify the representation, here will be omitted.
(c) Object a is a promoter, it means the rule can only be applied in the presence of object a.

5)
When the system halts, we will find the final result in membrane 1(i 0 corresponds to membrane 1 in Π TSP ).

1) Path construction:
When Π TSP starts, objects in skin membrane represent the undirected weighted graph: 1) a i represents the vertices of graph G; 2) e represents the end of inputting vertices; 3) in a Hamiltonian cycle, f i represents the starting vertex and the end one.

a) Visit vertex
To solve TSP, we firstly need to find all Hamiltonian cycle paths.That means we should visit from the starting vertex to all other vertices exactly once, then back to the starting vertex at last.In the beginning, the length of current path P is 0 because there is no vertex visited, then the length will increase by 1 if a vertex has been visited.The process are defined by rules in R C (1≤i≤n, 1≤j≤n, 1≤k≤n): We use rule r 1 to create sub-membrane which can determine whether there is an edge between two vertices, r 2 ∼r 8 are used to copy objects and transfer them to new membrane, r 2 ∼r 8 are executed for the determination whether add the new vertex to current path P .if there exist an edge between the last vertex of current path P to the new vertex, r 12 is executed,and n is the weight of the edge, otherwise, r 13 is applied, which means there is no edge from those two vertex.
If V i is the last vertex of current path P , and V j is the vertex being visiting.Firstly, r 1 ∼r 8 is used to create sub-membrane, copy and transfer objects to the new submembrane.If there exists an edge from V i to V j , the rule r 12 will be executed to create object b and r(the number of object r represents the weight of corresponding edge), and this means that V j will be added to the current path.If there is no edge from V i to V j , r 13 will be executed and object d will be created to dissolve the sub-membrane and objects in it, which means that is not a Hamiltonian cycle path.b) Back to the starting vertex f i When all the vertices have been added to the path P , if V j is the last vertex of path P , and there exist an edge from V j to f i , the path P is a Hamiltonian cycle path.And if there is no edge from V j to f i , the path P is not a Hamiltonian cycle path.The process are defined by rules in R C (1≤i≤n): After the execution of r 14 , a new sub-membrane and object p i (represent the starting vertex) will be created, object q i (represent the last vertex of path P ) will be created and sent into the sub-membrane with the execution of r 17 .At this time, r 12 will be executed to create object b and object r if there is an edge from the last vertex to the starting one.Then r 15 will be executed to create object object o and send objectw (indicate that there is a Hamiltonian cycle path) to outer membrane,and because of the existence of object o, all object r will be converted to r i to outer membrane.r 13 will be executed to create object d if there is no edge from the last vertex to the starting vertex.The object d will cause the execution of the r 16 , which dissolve the sub-membrane and shows that path P cannot be a Hamiltonian cycle path.

2) Path detection:
By detecting, it is judged whether the newly generated membrane is a valid membrane on the Hamiltonian path, and if it is not then pruning it.a) Judgment When rule r 15 in R C is applied, object w will be created to send to outer membrane, and it shows that a Hamiltonian cycle path has been found.Rules in R D associated with the process are: Rule r 19 is used to reduce the thickness of membrane and it can covert object w to object z.The existence of object s means that there are some sub-membrane not disposed in current membrane.r 20 is used to create object v and send object t to outside when there is no object s. the number of vertices in current path is represented by the depth of membrane.object p i represents vertex V i is on the current path, and the number of v represents the number of Hamiltonian cycle paths.If there is object s in current membrane, r 21 will be executed to create object v only.
If there is no Hamiltonian cycle path found, rule r 22 will be executed to send object h(shows that no Hamiltonian cycle path was found) to outside.r 24 will be executed if object s exists in outer membrane; if there is only object v exist in outer membrane, it shows that all sub-membrane have been disposed and there is Hamiltonian cycle path exist, and r 23 will be executed to delete object h and to send t to outside; if there is no object s and object v, it means that all sub-membrane have been disposed and no Hamiltonian cycle path was found, then r 25 will be executed to create object k for the next step.

b) Pruning
After path detection, we need to remain the meaningful membranes and objects which shows the found Hamiltonian cycle path and to abandon the useless membranes and objects In the following cases, pruning is required in Π TSP : i) Visiting each vertex.Let V i be the next vertex to be visited, and we need to find out whether there is an edge from the last vertex in current path to V i , we just create a new sub-membrane for this process by rule r 1 in R C .If there is no edge the sub-membrane and the objects in it will be dissolved by those delete rules in R D .The rules in R D associated with the process are: ii) All sub-membrane have been created.If all submembrane have been created in current membrane, we need to delete objects in current membrane except s, p i and reduce the thickness of current membrane.The rules in R D associated with the process are (1≤i≤n): r 36 is used to create new membrane with u i representing vertex v i has been added to current path.When there is no object a i (1≤i≤n) in current membrane, it means all vertices have been visited, and r 36 with a lower priority will be executed to create object g.Then the delete rules will be executed to delete relative objects and membranes.
iii) All vertices have been added to current path.The next step is to determine if there is an edge from the last vertex to the starting one.if not, object d will be created by r 13 in R C .Then r 31 and r 22 in R D will be executed to dissolve the sub-membrane and objects, and the current path is not a Hamiltonian cycle path.The rules in R D associated with the process are (1≤i≤n): iv) No Hamiltonian cycle path found after all submembranes were detected.In this case, we just dissolve the current membrane by the following rules in R D (1≤i≤n): 3) Path comparison: When all Hamiltonian cycle paths have been constructed, we need to find a path with a minimum cost among all Hamiltonian cycle paths.Starting from the innermost membrane to skin membrane, we move object r i (1≤i≤n) whose number represent the cost of one Hamiltonian cycle path to outer membranes and compare different paths to find a path with a minimum cost.Rules in R F associated with this process (1≤i≤n, 1≤j≤n): The strategy of our comparison is pairwise comparison, rule of type r 41 and r 42 is used to control that only two Hamiltonian cycle paths are compared every time.Because of the uniqueness of object m in a membrane, object r i will be converted to object β i sequentially.The number of object r i and r j represents the cost of two different Hamiltonian cycle paths (path i and path j), the subscript of object r is decided by the subscript of object p in the corresponding sub-membrane.When object r i and r j has been converted to β i and β j by applying rule r 42 , rule of type r 44 will be used to convert β i and β j to β. Assume that the number of β i is less than β j , which means that the cost of path i is smaller than path j.So after rule r 44 is applied, β j will be left.Then rule of type r 45 , r 46 and r 47 will be applied to delete α j and all of object β j .What's more, rule of type r 48 will be applied to delete object γ.
After all object r j has been deleted, we need to convert β to β i for letting the process of comparison continue.When rule of type r 49 is applied, α i will be dissolved and ζ will be converted to ζ i .And because the existence of object ζ i , β will be converted to object β i under the application of rule r 50 .By now, a pairwise comparison has completed, object r j which represent the larger cost of a Hamiltonian cycle path has been all deleted.Rules in R P will applied until all object r k (1≤k≤n) which don't represent the Hamiltonian cycle path a minimum cost in the membrane are deleted.Object y is used to start delete rules, the subscript of object y is decided by the subscript of object p in the corresponding sub-membrane.When object y i exists and α i is dissolved, a Hamiltonian cycle path has been detected that doesn't have a minimum cost.Then under the application of rule r 51 , r 52 and r 53 , object y i will get in and out sub-membranes continuously until the subscript of object p in a membrane is the same as y i .After rule r 52 in sub-membrane is applied, object x will be created.When object x exists, rule r 54 will be applied to create object d and send object x into sub-membrane.Because of the existence of d, the membrane and objects in it will be dissolved.With the implementation of rule r 54 , all corresponding sub-membranes will be dissolved.Once object v doesn't exist in membrane, path comparison in this membrane has completed, we need to move object r i to outer membrane.Rule r 55 will convert β i to n i when object v doesn't exist in membrane, then all object n i will be convert into r j and be sent out because of the existence of object p j .
C. Parallelism Analysis of Π TSP 1) Analysis of Π TSP : For a complete undirected weighted graph with n vertices, we can see that the number of all possible Hamiltonian cycle path is at most n! by using the exhaustive method.So as long as taking n! case into account and judging that whether each case can constitute a ring, we can find all the Hamilton loop.As is shown in Fig. 4, this process could be described as construct a multi-tree where each possible Hamiltonian cycle path could be found.When the P system starts, let the starting vertex be V 1 , in the outermost membrane is the objects represent the rest vertices V 2 ∼ V n .For every V i (2≤i≤n) hasn't been visited, we create a new membrane to judge whether there is an edge from V 1 to V i (corresponding rule is r 1 ).If the two vertices are connected, the new sub-membranes will be remained (corresponding rules are r 2 ∼r 8 ).Then for the n-2 vertices that haven't been visited, n-2 new membranes will be created continuously in just submembranes.The process will be repeated until each vertex is on the path.What can be summarized by the above process is n! case could all be taken into consideration.For each of the generated path, we judge whether there is an edge between the two vertices in the new sub-membrane (corresponding rules are r 12 and r 13 ).If there is an edge connected between two vertices, then the sub-membrane will be remained; otherwise, we need to dissolve surplus membranes and pruning is needed in four situations in Π TSP (crucial corresponding rules are r 13 , r 22 , r 31 and r 40 ).So when the process of path detection is completed, only membranes that represents Hamiltonian cycle paths will be remained.
Hamiltonian cycle paths are represented by a series of membranes that are nested one by one in our P system.As described in algorithm PATSP, all Hamiltonian cycle paths constitutes a multi-tree together.Because each leaf node represents a Hamiltonian cycle paths, so to find the solution of travelling salesman problem, we only need start from the leave nodes of the multi-tree to compare the weight of each Hamiltonian cycle path until we find the Hamiltonian cycle path with minimum weight.In our P system, starting from the innermost membranes, then compare the weight of each Hamiltonian cycle path (corresponding rules are r 41 ∼r 44 ) and delete the the corresponding membrane structures (corresponding rules are r 45 ∼r 48 and r 51 ∼r 54 ) represents Hamiltonian cycle paths without a minimum weight.What's more, transfer the weight of the path has a bigger weight to outer membrane (corresponding rules are r 55 ∼r 56 ) and continue the process of comparison until we find the path with a global minimum weight.What can be summarized by the above process is the right result will be generated when the whole system halts.
2) Analysis of time complexity: According to the maximum parallelism of P systems, the rules that meet their requirements will be executed at the same time.As shown in Fig. 5, it is the process of the execution of rules in Π TSP .We assume that the time cost for executing a rule is a slice.What's more, rules like [r i ] means r i could be executed or not in Fig. 5.

a) Cost of path construction
The process of path construction is to use the parallel computing methods to construct every possible Hamiltonian cycle path.For a complete undirected weighted graph with n vertices, the number of vertex on a Hamiltonian cycle path is n too.For the i th vertex on the path, there are n-i vertices that should be taken into consideration (n − i + 4 slices).So the whole process will take n i=1 (n − i + 4) slices.

b) Cost of path detection
The process of path detection and path construction happens at the same time.Dissolving membranes that represent one illegal Hamiltonian cycle path cost constant time (up to 3 slices).Because path construction and path detection happens parallel, so it cost about 3×n slices in total.c) Cost of path comparison One comparison costs 8 slices.Because the process of path comparison is parallel and starts from the innermost membranes.For an undirected weighted graph with n vertices, the depth of membranes is n.So it cost 8n slices in total.

d) Cost of path cutting
The process of path cutting happens at the same time with path comparison.One path cutting costs 3 slices.When the depth of membranes is n, the total cost of path cutting is 3n slices.In summary, the total cost of Π TSP can be computed as follows: In [17], author uses RanGen (Randomly Generating) MCGA (Membrane-Computing-Genetic-Algorithm) to solve travelling salesman problem, the time complexity of the algorithm is O(n 3 ) time.This computation is much faster than that of brute force complete enumeration method in serial, but is still slower than PATSP algorithm.Compared with the traditional ant colony algorithm and genetic algorithm, our algorithm is not only better in time complexity, but also can solve the exact solution of the problem.

V. CALCULATE INSTANCE
In this section, An example is given to show the whole process to solve TSP in Π TSP .
The undirected weighted graph G=(V , E) is shown in Fig. 2, let V 1 be the starting vertex (also the last vertex).The process in Π TSP are as followed:

A. Path Construction
Objects represent the undirected weighted graph which should be input to the skin membrane.Firstly, input multiset p 1 a 2 a 3 a 4 a 5 , then input f 1 , last input mbs 3 ζ.We will construct legal paths by membrane creation.The available rules in R C are applied in the order of {r 1 }→{r 2 ∼r 8 }→{r 9 ∼r 11 }→{r 12 }.There is multiset s 3 p 1 ba 2 a 3 a 4 a 5 f 1 mζ in membrane 2, rule r 1 is used to create sub-membrane and r 2 ∼r 8 are used to copy objects and transfer them to new sub-membrane.At first, the length of current path is 1, and object p 1 shows that the vertex V 1 has been added to current path.Then r 1 ∼r 8 will be executed to create a new sub-membrane with multiset s 3 tq 1 p 2 a 3 a 4 a 5 f 1 mτ ζ to determine if there are edges from V 1 to V 2 , V 3 , V 4 , V 5 .As shown in Fig. 2, there exist an edge from V 1 to V 2 .So rule r 12 in R C will be executed, multiset q 1 p 2 are converted to p 2 br 5 and the new sub-membrane will not be dissolved, which means that V 2 has been added to current path.There are same process when disposing V 4 and V 5 , because there are edges from V 1 to them.And the sub-membrane will be dissolved when disposing V 3 because there is no edge from V 3 to V 1 .Objects in sub-membrane continue to evolve, and there is multiset s 2 p 2 ba 3 a 4 a 5 f 1 τ in the new sub-membrane when disposing V 2 , which shows that V 2 is the last vertex in current path and V 3 , V 4 and V 5 have not been visited.So the next step is continue to create new sub-membranes to visit V 3 , V 4 and V 5 .
If all vertices have been visited and added to current path P , the next step is to determine whether there is an edge from the last added vertex to the first one of path P .After we have added V 3 ,V 4 and V 5 to current path P (because there are edges connecting them), we consider the edge from V 5 to V 1 , so the rule r 14 and r 17 in R C is applied.V 1 will be added to current path P with the execution of r 12 and path P is a Hamiltonian cycle path.
B. Path Detection 1) Judgment: As shown in Fig. 6, after r 15 in R C are applied, object w will be created and sent to membrane 5 which means there is a Hamiltonian cycle path found.And now there is a multiset wtp 5 mτ ζr 27 in membrane 5, after r 19 in R D is executed the multiset in membrane 5 will change to mtp 5 zζr 27 .Then r 20 in R D will be applied to create object v and send object t to membrane 4.The rule r 21 will be executed to evolve multiset szt to vz.
As shown in Fig. 7, when object d is created in membrane 6, which means there is no Hamiltonian cycle path.After that, membrane 6 will be dissolved by r 16 and object d will be sent to membrane 5.Then object d will be converted to object k and the thickness of membrane 5 will be reduced by the execution  of r 31 in R D .Because of the existence of object k, rule r 32 in R D will be applied to dissolve object p 3 in membrane 5.
2) Pruning: The process of pruning is to dissolve the surplus membranes and objects and remain the meaningful membranes and objects which indicate the Hamiltonian cycle path.The associated execution of rules in this example are as followed: a) As shown in Fig. 8, because there is no edge from V 1 to V 3 , rule r 13 is applied to create object d.Then membrane 3 and all objects in it will be dissolved by the execution of rules in R D .b) As shown in Fig. 9, all objects a i has evolved to u i which means that all vertices have been visited.Then rules in R D are applied in the order of {r 36 }→{r 37 , r 38 , r 39 }→{r 40 }.With the execution of those rules, objects in membrane 2 will be dissolved except s, p i .c) As shown in Fig. 10, all vertices have been added to current path P .However, there is no edge from V 3 to V 1 , so r 13 in R C is applied to dissolve membrane 6 and object d will be sent into membrane 5, then object d will evolve to object k due to the execution of rule r 31 in R D .d) As shown in Fig. 11, there is no Hamiltonian cycle path found and all sub-membranes of membrane 4 have been disposed.With the execution of rule r 25 and r 32 in R D , membrane 4 and objects p 2 in it will be dissolved.

C. Path Comparison
As shown in Fig. 12, two Hamiltonian cycle paths has been found in membrane with the cost of 23 and 27.We need to find the smaller one between the cost of two Hamiltonian cycle paths.Because of using of rule r 18 in R C , all object r will be sent out from the innermost membrane.After rule r 19 and r 20 in R D is applied in membrane, the number of object v in membrane 5 is 1, after rule of type r 41 and r 42 in R F is applied, all object r 1 has been converted to object β 1 .Then rule of type r 55 and r 56 will be applied to convert object β 1 to object r 5 and send all object r 5 to membrane 4. Similar to the application of rules in membrane 5, all object r 5 will be converted to object r 4 and will be sent into membrane 3.By now, the membrane structure is shown in Fig. 13.
Rule of type r 41 in R F is used to create object c 4 which is used to convert all object r 4 to β 4 and because of the existence of object β 4 , object c 4 will be converted to object m.As is shown in Fig. 14, all object r 4 in membrane 7 will also be sent into membrane 3 and will be converted to object r 5 .After rule of type r 41 ∼r 43 in R F is used, object r 5 will be converted to object β 5 , then the comparison of the cost of two Hamiltonian cycle path will start.After rule of type rule r 44 in R F is applied, object β 4 and object β 5 are converted to β.And three object are left in membrane 3.So rule of type r 45 will be used next to create object y 5 which is used to delete object β 5 , α i , and γ.By now, objects r 5 which represents the larger cost of two

D. Path Cutting
After a path comparison, we have known membranes and objects which represent a Hamiltonian cycle path with a larger cost.As shown in Fig. 15, membrane 7 and its sub-membranes should be dissolved.Object α 5 has been deleted because it represent the path with a larger cost.By applying the rule of type r 51 ∼r 53 in R T , object y 5 will be sent into a submembrane which has object p 5 .Then by applying rule of type r 54 in R T continuously, object d will be created to start delete rules.As a result, corresponding membranes and objects will be dissolved.What's more, β 4 will be converted to n 4 by applying rule of type r 55 in R T because object v has been all dissolved which means that a path comparison has been completed.Then n 4 will be converted to object r 3 and will be sent to outer membrane to start a new path comparison because of the existence of object p 3 .By now, a path cutting has been completed.

E. Final Result
When the whole system halts, the final membrane structure is shown in Fig. 16.As we can see in Fig. 16, only membranes and objects that represent the Hamiltonian path with a minimum cost are remained.Object p i represents vertex v i in graph.By detect object p i in each membranes, we knows the path is:

VI. CONCLUSIONS
The cell-like P system is a new computational system inspired by biological cell behavior.This paper presents a cell-like P system Π TSP to solve travelling salesman problem with O(n 2 ) complexity.In Π TSP , we firstly construct all Hamiltonian cycle paths by membrane creation, then find the Hamiltonian cycle path with a minimum cost, lastly remove all membranes and objects that do not contain the TSP solution.Finally, an example is given to illustrate the feasibility and effectiveness of our P system.

Fig. 1 .
Fig. 1.The structure of cell-like P system.

Fig. 3 .
Fig.3.The initial structure of the P system Π TSP .

Fig. 5 .
Fig. 5. the process of execution of the rules in Π TSP .