Abstract

One of the known methods for solving the problems with exponential time complexity such as NP-complete problems is using the brute force algorithms. Recently, a new parallel computational framework called Membrane Computing is introduced which can be applied in brute force algorithms. The usual way to find a solution for the problems with exponential time complexity with Membrane Computing techniques is by P System with active membrane using division rule. It makes an exponential workspace and solves the problems with exponential complexity in a polynomial (even linear) time. On the other hand, searching is currently one of the most used methods for finding solution for problems in real life, that the blind search algorithms are accurate, but their time complexity is exponential such as breadth-first search (BFS) algorithm. In this paper, we proposed a new approach for implementation of BFS by using P system with division rule technique for first time. The theorem shows time complexity of BSF in this framework on randomly binary trees reduced from to .

1. Introduction

Membrane Computing, introduced in 1998, is an area of study in computer science [1]. Membrane Computing could be considered as a framework in the distributed parallel computing, and it is inspired from the computing ideas, structures, models, the living cells activities, and the cells organized in a hierarchy. Using Membrane Computing, we obtain a computing device called system. Several membranes are included in the basic model of a system, embedded in a main membrane that is known as the skin. The Euclidean space is divided by membranes into some regions consisting of some objects (that are generally signified by alphabetical symbols) and the evolution rules. Applying these rules, the objects can be evolved and/or moved from a region to their adjacent regions. Typically, these rules are employed in a nondeterministic and maximally parallel manner. After an initial system configuration, the computation starts, and it terminates once no evolution rule could be applied. The computation result can be a multiset of objects that are embedded in an output membrane or discharged from the system skin.

So far, several types of system have been introduced and investigated [13]. system with active membrane is one of the most well-known systems in which the number of membranes increases during a computation by using some division rules, creation rules, or separation rules [47] (we call them in short system with membrane division or system with division rule, system with membrane creation or system with creation rule, and system with separation rule, respectively). They make models of the division or creation of the cells in the nature. In the initial variant of system with division rule [8], the division rules were defined in such a way that, from the division of a membrane, we could always obtain two membranes (we call it a 2-bounded division or, in short, division rule). A generalization was defined in [9] where a membrane can be divided into several (but a finite number of) membranes (we call it a -bounded division). Also in system with creation rules, some objects are so productive that they create membranes [10]. Thus, new membranes can be made exponentially.

Most of systems are proved to be universal [1, 1114] and efficient [8, 15, 16]. Several studies have been performed on the system with active membrane. In most of these studies, the time complexity is reduced from exponential to polynomial or linear time in an exponential workspace or, at least, they have improved the time complexity as follows: using system with division rules; it was shown that the NP-complete problem SAT can be solved in a linear time [8]. As investigated in [9], the HPP can be solved using systems with -bounded division rules in polynomial time, but in [17], it was shown that HPP can be solved using systems with division (2-bounded) rules in which the time complexity for this problem was linear, and the knapsack problem has been solved using a family of deterministic system with division rules presented in [18] in linear time. Using systems, some other problems (mostly NP-complete) have been solved in linear or polynomial time complexity, for example, SAT problem in [7, 19, 20], graph problem [21], subset sum [22], 3-COL problem [23], vertex cover problem [24], HAM-CYCLE problem [25], and HPP problem in [10]. systems are also used to solve PSPACE problems [2629].

In all researches conducted on this area of study, the time units are considered as the steps of computation in a system, which are performed in parallel, in evolution rules, all membranes of the system, or the membranes division [8]. It is clear that execution of the system framework programming on a sequential hardware does not give us a relevant result, unless it is applied on a parallel architecture. Recently, some studies were conducted on the implementation of Membrane Computing on the parallel architecture [3034]. In all of the studies, the speed execution has been extremely increased.

On the other hand, classical search algorithms explore systematically the space of states through the saving of one or more paths in the memory and, then, recording the alternatives existing in each choice point. Once a final state is explored, the path considered as the transitions sequence is known as the solution to the problem. Many of the methods presented are designed specifically for solving the classical search problems. There are different heuristics and approximation algorithms that have found the solution in a reasonable time, but, at the same time, they may be less accurate or even they may have a good accuracy but with an exponential complexity in time [35]. One of these algorithms that have been proposed and designed already is breadth-first search (BFS). Therefore, like the parallel algorithms, few attempts have been made for improving the time complexity of the accurate searching methods.

So far, many researches (especially in real life problems) on classical searching have been conducted to reduce time implement and improve speed execution. Li et al. in [36] proposed a new algorithm that can be applied in searching for the multiple longest common subsequences (MLCS). In terms of the speed of the execution, it outperforms the previous leading parallel MLCS algorithm. In [37], the scheduling problem has been studied, in which a modified weight-combination search algorithm and a variable neighborhood search were employed to yield the optimal or near-optimal schedule. The results showed that the obtained solutions were near-optimal solutions in a reasonable computational time. Liu et al. [38], by combination of BFS and depth-first search (DFS) algorithms, obtained two new algorithms; these algorithms are known as memory function maximum degree algorithm (MD) and memory function preference degree algorithm (PD). In these cases, simulation results show that the two algorithms’ performances are excellent at the same time, and the performances are improved at least 10 times. In another study, Shih et al. [39] proposed a new method for development of a splitting-based schema called Merged Search Tree to improve the schema of binary search tree defined in the radio frequency identification (RFID) system. Merged Search Tree method greatly improved the time and power performance simultaneously.

In this paper, we propose a new parallel method by system with division rule through the exploration of BFS in a binary tree which includes positive integer weight and with finite depth. With this new method, the time complexity will be decreased from exponential to linear time. The paper is organized as follows: Section 2 describes the related works. In Section 3, we presented some basic definitions on system with division rule. Section 4 introduces the BFS. The proposed method for BSF based on system with membrane division is presented in Section 5, in which we provided some guidelines of the implementation of system with membrane division for BFS. In Section 6, using two examples, experiments carried out in this study are presented. Finally, in Section 7, we presented the conclusion, and some ideas for future works were discussed.

The searching problem has been recently studied on the framework of Membrane Computing. A first study on DFS, was presented by Gutiérrez-Naranjo and Pérez-Jiménez [40, 41]; also the first study on local search was presented by Gutiérrez-Naranjo and Pérez-Jiménez [40, 41]. In both cases, the search is done using transition systems; also N-Queen problem has been considered in these researches as the case study. The results have been compared to N-Queen problem in [42] and to one other. The solution presented for 4 queens in [42] was obtained after 20,583 seconds (more than 5 hours). The average time obtained for 20 queens in [40, 41] approaches are 15,944 and 0.133275 seconds, respectively.

Also DFS in [43] and BFS in [44] have been studied on disjoint paths using systems. In the second one, the execution time was improved compared to the first study. In [45], BFS has also been proposed for solving disjoint paths problem using systems. In this study, the execution time has been improved in comparison with the previous study. In all three cases, the searches were done without division rules.

3. P System with Membrane Division

One of the models that have been mostly studied in the field of Membrane Computing is the system with membrane division, which is well recognized in the system community. This model is one of the first models introduced in 2001 [8].

Definition 1. A system with division rule for elementary membranes and with output is a construct of the form, where(1) signifies the initial degree of the system;(2) denotes the alphabet of symbol-objects;(3) is the output alphabet; (4) indicates a finite set of labels for membranes;(5) stands for a membrane structure, consisting of m membranes that initially have neutral polarizations labeled with elements of H;(6) indicate strings over , which describe the initial multisets of the objects placed in the regions of ;(7) determines the output region; (8)R stands for a finite set of rules of the following forms:(a), for    is set of strings over .This is an object evolution rule that is accompanied with a membrane which is labeled with h, and it depends on the membrane polarity. The empty string is represented by .(b), for . An object is sent in from the immediate outside region of the membrane with the label h; at the same time, this object would be changed into another object, and, simultaneously, the membrane polarity can also be changed.(c), for . Here, an object is sent out from the membrane with the label to the immediate outside region. This object, at the same time, changes into another object, and, simultaneously, the membrane polarity can be changed.(d), for . A membrane labeled with is dissolved in reaction with an object. The skin is never dissolved.(e), for . A membrane by an object could be divided into two membranes with the same label, each of them containing one object (objects may be the same or different). And the polarities of these membranes can be altered.

These rules are employed based on the following principles.(1)All rules are used in a parallel (we can determine the priority for some rules) and in a maximal manner. At each step, one object of a membrane could be utilized by only one rule that is chosen in a nondeterministic way, but any object that is able to evolve by one rule of any form should do its evolution.(2)With dissolution of a membrane, its contents (multiset and internal membranes) are left free in the surrounding region.(3)All objects and membranes that have not been specified in a rule and those that have not evolved remain unchanged to the next step.(4)Those rules that are associated with the membranes that are labeled with h are utilized for the all copies of this membrane. At one step, a membrane that is labeled with h could only be subjected to one rule of types (b)–(e), and rule (a) could also be applied with other rules. In this case, our assumption is that the evolution rules of type (a) are used first, and after that, the other types of rules are applied. This process takes only one step to be performed.(5)The skin membrane could not be divided. Like other membranes, it can have “electrically charge”.

Definition 2. One says that rule has priority (in the strong sense) over rule ; if can be applied, then rule cannot be applied. In this case one shows .

Definition 3. Let be an output membrane (region) of system ; one says that is a dynamic output if the system rules can apply on .

It should be noticed that in the case of systems with division rule, there is an evolution in the membrane structure during the time of computation. This evolution could be obtained not only by declining the number of membranes that may happen due to dissolution operations (rules of type (d)) but also by an increase in the number of membranes by division. It could be an exponential increase in a linear number of steps: by applying a division rule after n steps, and because of the maximal parallelism, we get copies from the membranes of the same labels. It is an approach that has been mostly investigated to obtain an exponential workspace to reduce the time through increasing the space for solving the computationally hard problems (such as NP-complete problems) in a polynomial or even linear time.

Searching is based on numerous processes in the artificial intelligence. The most important point is that lots of real-life problems could be settled as a space of states. A state refers to description of the world in a certain instant (expressed in some languages), and two states are linked by a transition if the second state can be reached from the previous one by applying one elementary operation [35].

As mentioned above, using this abstraction, the searching methods have been widely studied regardless of the problems arisen in the real world. The studies have been conducted on aspects such as the completeness (where the searching method can find a solution, if any), time and space complexity, and optimality (whether the solution is optimal in some sense). Considering the searching tree, wherein the nodes indicate the states and the arcs represent the transitions, the classical search focuses on the order in which the nodes of the tree should be explored. In this search, there are two possible approaches; in the first instance, the blind search in which the search is guided only by the topology of the tree without any information from the states. In the second instance, the informed search in which some information about the nodes’ characteristics are employed for defining heuristics to determine the next node to be explored.

In each time unit of the sequential algorithms, a single node is considered. In this computation framework, the searching strategies are determined through the different orders in which the new nodes are explored. Within a typical framework, several nodes could be possibly explored, and, for continuing the search, we should select one of them. In the best state, there is a heuristic that can be helpful while choosing the best options from the existing candidates. In a certain sense, this heuristic indicates the distance of the considered node from a solution node, and this property provides us with information about the problem nature. In lots of other situations, we cannot have access to any information about this distance, and a blind strategy is required to be applied.

Due to the lack of information about the problem nature, the blind strategies are considered exclusively within the topology of the graph (tree) and also in the order where new nodes are reached. The BFS is one of the basic types of the blind search strategies, which expands the nodes in an order regarding to their distance from the root (Figure 1(a)). The time complexity for this search strategy is , where represents the maximum branching factor and signifies the lowest depth in which the solution could be found (for more information, see [35]).

5. Proposed Method

In this section, we present a first approach to BFS by systems with membrane division. The goal of this approach is to show that Membrane Computing provides all the ingredients that we need to find a solution for any problem represented as a space of states and, hence, to be a useful tool to solve many real-life problems. In this approach, our aim is looking for a solution in search space (binary tree) by using a system with membrane division according to BFS.

5.1. An Overview of Breadth-First Search by System with Membrane Division

In this section, we provide the design overview of a system family with membrane division of searching according to the BFS binary trees with positive integer weight and with finite depth. The substance of the research is as follows: in initial configuration, the system explores the root (start state); then, it checks to find the goal (final state), if any. Next, the computation will be halted and the remaining nodes show the path from start to goal. If the goal does not exist, then the system divides the membranes (elementary membrane that located in the skin), explores the next level (depth) of nodes (Figure 2), and checks again to find the goal (see the proposed method in Figure 3). The computation will be continued until the goal is found. Considering the fact that each level of tree is explored in one stage (Figure 1(b)), and if the goal exists at the depth d, the goal will be discovered after stages (stage 0 for root, stage 1 for depth 1, and stage d for depth d).

In Section 5.2, it will be demonstrated that each stage takes 4 steps (except stage one), and the time complexity of this method is . So the time complexity for BFS at this method will decrease from to . On the other hand, we know that one of the challenges that have arisen on the search threads is complexity in time, hence using a system with membrane division can be a very convenient way for searching with low time complexity. Also, because of the parallel operation of the rules, the time execution will reduce in the system.

5.2. Breadth-First Search Problem Formulation and System Structure

In this section, we consider a system with membrane division for BFS on binary trees and explain their features according to Section 5.1. We illustrate the rules and their implementation, step by step. It is noticeable that each binary tree’s node has four fields: a key node, parent pointer, left child pointer, and right child pointer. The key node is the label or weight of a node, and pointers are the interface between the parent, the left and right children nodes. With this brief introduction, we explain the case study tree that considers the random binary tree with the following features.(i) Depth of tree is integer number , where ;(ii) the node is shown by ;(iii) the left and right child pointers for are and , respectively;(iv) the key node for is , we show key ;(v) the key node for final state (goal) is , we show key () ;(vi) the relationship between and its parent is considered by (vii) the numerical inputs of system are , and .

Note that in all of above relations .

We also define the system structure as follows.

We will consider system with dynamic output and with the strong priorities , where(i)the working alphabet ;(ii)the output alphabet ;(iii)the set of labels ;(iv)the initial membrane structure ;(v)the initial multisets and .

We also consider the set of rules R as follows: This rule produces copies of by in membrane 0 (skin); Using these rules, the membrane with label 1 is recharged and dissolved; these rules are applied when the answer is obtained, and computation halts After applying these rules, a copy of will be sent to outside and the charge of membrane is changed; after that, all copies of t disappeared, in membrane 1 with positive charge In first case, object changes the charge of membrane 1 from neutral to negative and sends object y out of membrane; at the same time, disappeared. This rule will be applied when there is no any object of t in membrane 1 with neutral charge (see ), and it means that the answer is here (see ). In the second case, changed the charge of membrane 1 from positive to neutral, and the process is ready to continue Object divides membrane 1 and sends and to core of each new membrane, that they produce the children of current parent’s node in the next step. If node is nil, then , and, in the next step, node will not be produced. If node is not nil, then, and, in next step, node will be produced: From , rules makes , , , and some copies of , among them, is a current node. If , then we have one copy , and it makes the properties of ’s children in the next step (see ). If , then the computation in this branch will be stopped. The appearance of means that the goal (G) is not yet reached; therefore, rule is applied and the process will continue. If there is any copy of , it means that the goal is reached; therefore, rule is applied and the process will be stopped after applying rules and .

Remark 4. We denote the system configuration in step by , and is initial configuration.

Remark 5. We consider a path from root until node in a binary tree with depth, by , where ,  ,  .

Lemma 6. Let be a nonnegative integer number, and be natural numbers, and let and , where and . If is the system mentioned above, then there exist membranes with label 1 and neutral charge including a multiset in the form    in configuration .

Proof. We will prove the lemma by induction on .
Case  1  (). In initial configuration (), there exists only object in system that is located inside membrane 1 with neutral charge. Therefore, in step one, the rules of type will be applied, object is changed into , and thus the proposition is true for .
Case  2   . Let be such that , by inductive hypothesis, there exist membranes with label 1 and neutral charge including a multiset in the form in configuration . In this configuration, if , then rule will be applied (rules , and can be applied on objects , , and , respectively, but with this order ) in step , and this rule changes the polarization of membranes 1 from neutral to positive. After that, in step , rule will be applied, and it changes the polarization of membranes 1 from positive to neutral. If , then rule will be applied in step ; after that, rules and will be applied simultaneously (see Section 3, principal 4) and will be obtained. In both conditions, and will disappear and we obtain membranes with label 1 and neutral charge, and each membrane includes a multiset in the form . Now rules is applied in step and each membrane will be duplicated; half of them include , and the remaining include . Therefore, we have membranes with label 1 and neutral charge; each of them includes one multiset such as (1) or (2). In step , rules will be applied and multisets andwill be changed to and , respectively. On the other hand, we know that and ; then, in step , we have membranes with label 1 and neutral charge, and each membrane includes one multiset in the form , . Thus, the proposition is true for all numbers , , and, in configuration , there exist membranes with label 1 and neutral charge, and each membrane includes a multiset in the form .

Note. According to Lemma 6, if there is not any goal, computations will continue to depth n.

Lemma 7. If the assumptions to Lemma 6 are satisfied, then for each , there exists a membrane with label 1 and neutral charge, including in configuration .

Proof. It is evident according to the definition of , there exist copies of   ; also according to Lemma 6, in configuration there exist membranes with label 1 and neutral charge, including a multiset in the form , and thus the lemma holds for each .

Theorem 8. The BFS can be implemented on a binary tree by a system with division rule in a linear time.

Proof. Let the goal be located in the nearest depth d; it means there exists at least a ,   such that and , for all   ). We consider a system and a complete binary tree ) according to assumptions presented in Lemma 6 and according to Remark 5 ( is the path from root until node ). By Lemmas 6 and 7 the whole of paths from root until depth are explored in configuration . Hence, in step , one of membranes (perhaps more than one) with neutral charge includes just (there is no ; it means that the goal is here and shows the path from root until goal). We consider this membrane with label . Next, in step , for membrane , rule and for membranes 1, rule will be applied simultaneously. In this case, object changes the polarization of membrane , and it sends an object out of the membranes and disappears, simultaneously. In this moment, membrane has the negative polarization, so any rules cannot be applied on it. Also in step , object changes the polarization of membranes 1 from neutral to positive charge. In step , each object evolves to in membrane 0 by rule , and, at the same time, object will be dissolved in membranes 1 by rule , and object will be sent out of membranes 1 and changes the polarization of membrane from positive to neutral charge by rule . The rules apply maximally parallel manner. In step , one copy of object that have been produced in step will be sent to each membrane with label 1, and the polarization will be changed from neutral to positive by applying rule . In step (the last step), object dissolves membranes 1, and the computation will be halted. Finally, membrane (perhaps some membrane) with label 1 () will be remained with negative charge that shows the place of the goal by the path (multiset ) that is located in each membrane. Therefore, the presented system explores a complete binary tree according to BFS method in a linear time. It is clear that even if the tree is not complete, the theorem is true.

6. Experimental Simulation

We will give some hints on the computation by following the computation of the examples that were shown in Figures 4(a) and 4(b).

Example 9. Let us find number 6 in the tree according to Figure 4(a). Therefore , and you can see the weights on the tree. In configuration , there is just one object that occurs in membrane 1; therefore, for the first time, rules is applied and we achieve in membrane 1 for configuration . Next, rule and after that and are applied ( and are applied simultaneously), objects and will be dissolved (obtaining ), and the system will be ready to continue; then we can apply rules (obtaining ) in the next step. This is the first time that we divide membrane 1, so there are two membranes with label 1 in in which one of them contains and another one contains . In step , rules can be applied and multisets are changed to and .

Now the computation will be repeated as above. Therefore, in , we have eight membranes with label 1 and neutral charge that each one contains one of the multisets , , , , , or . In the next step, two rules are applied at the same time, and , and is obtained. Rule is applied on membrane that contains multiset (goal is here); this rule makes disappear, makes one copy of in region 0, and changes the polarization of the membranes from neutral to negative charge, but is applied on other membranes and changes their charge from neutral to positive charge. will be obtained after applying rules , and , simultaneously. In this case, objects are dissolved by , and, by applying rule on the whole membranes, the charges will be changed from positive to neutral, except the membrane containing multiset and has negative charge; also there will be copies of by applying rule . After applying rules and , all of the membranes will be dissolved, except for the membrane containing with negative charge; we achieve , and computation is halted. It can be seen that the path for searching from start (root) to the goal in the membrane remained . In addition, it can be seen also that the brief of computation in Figure 5 shows paths’ multisets.

For verification, we run the program in an updated version of the P-Lingua [46]. The final configuration (configuration 17) is shown by P-Lingua simulator in Figure 6.

Example 10. Let us find number 7 in the tree shown in Figure 4(b). Therefore, , and you can see the weights on the tree. This tree is not complete and there are 4 goals in depth 4, the proposed method can find all of the goals. The simulation is carried out using P-Lingua shown in Figure 7.

7. Conclusion and Future Works

Due to the high computational cost, many classical methods have exponential time complexity. Since breadth-first search is one of these cases, for searching solution to real-life hard problems, it is very important to decrease time complexity. The proposed method has been successful in decreasing the time complexity.

Using system with membrane division, this study presents an advanced approach to find a solution to the problem of breadth-first search. An exponential workspace has been created to decrease the time complexity from an exponential to a linear time. For the future studies, it is recommended to improve the design from the system aspect that may include new ingredients and polynomial or linear uniform. Another recommendation is to conduct new case studies that are more connected with real-life problems. A study can be carried out on the implementation of this design on one parallel architecture and compare the results with the obtained ones from a sequential architecture.

Conflict of Interests

The authors confirm that there is no conflict of interest between the authors and the P-Lingua company, which has been used for programming the algorithms in the paper. The reason that the name of the programming code has been mentioned is that the authors would like to help the readers to compare their future studies with this manuscript. The authors also confirm that there is no conflict of interests, either financially or intellectually, that may bias the revision of this manuscript.

Acknowledgments

This work is supported by The Ministry of Higher Education (MOHE) under Research University Grant (RUG 03H72). The authors would like to thank Research Management Centre (RMC), Universiti Teknologi Malaysia (UTM) for the support in R&D and Soft Computing Research Group (SCRG) for the inspiration in making this study a success. The authors would also like to thank the anonymous reviewers who have contributed enormously to this work.