11
GRADIS – The multiagent environment supported by graph transformations Leszek Kotulski, Adam Se ßdziwy * Department of Automatics, AGH – University of Science and Technology, Al. Mickiewicza 30, 30-059 Kraków, Poland article info Article history: Available online 23 May 2010 Keywords: Distributed graph transformations Multiagent systems GRADIS abstract The specification and simulation of a complex multiagent system needs an abstract repre- sentation that is powerful enough to describe a solved problem and sufficiently abstract to understand and illustrate its behavior. Complementary graphs concept enables the distri- bution of a graph representation of a system knowledge and allows its independent mod- ifications by agents, in such a way that this representation remains consistent. A problem representation from the centralized and distributed point of view makes the partial graphs the useful tool for a multiagent system designer. It also creates an environment capable of verifying the features of multiagent systems (represented by graph metrics) by simulation of a multiagent system behavior. Ó 2010 Elsevier B.V. All rights reserved. 1. Introduction Multiagent systems are often characterized by the complex and sometimes unpredictable interactions between their autonomous components. The inherent complexity presents a barrier to their analysis and understanding. Moreover, there is no formal representation of a knowledge maintained by these agents. Current research concentrates either on the speci- fication of the local agents’ behavior [19] or on the specification of a communication between them [20]. The specification and the simulation of a whole complex multiagent system behavior fail because we lack its description which would be pow- erful enough to describe the solved problem and sufficiently abstract to understand and illustrate its global behavior. Let us note that this abstract description should enable us to represent a knowledge maintained by an agent system and to map its parallel changes as a result of the agents’ activities. The first demand seems to be fulfilled by the graphs structures and their transformations. This area has been continuously and systematically developed for over 40 years [22,2,3]. There are a lot of examples of graph transformations applications in many areas such as visual and object oriented languages, specification of languages and related tools, and specification, modeling and visual design of the distributed systems. Thus graph transfor- mations seem to have powerful enough notation describing formally the various aspects of the software systems. Unfortu- nately, their common feature is a centralized graph representation. This remains in contradiction to the multiagent system approach because its basic features [23] imply that: – each agent has incomplete information or capabilities for solving a problem and, thus, a limited point of view; – there is no global system control; – a data is decentralized; – computations are asynchronous. To resolve this contradiction we have to consider the possibility of the graph distribution and parallel transformation (or, more precisely, parallel transformations made on distributed subgraphs). Complementary graph (described in Section 2) is 1569-190X/$ - see front matter Ó 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.simpat.2010.05.013 * Corresponding author. E-mail addresses: [email protected] (L. Kotulski), [email protected] (A. Se ßdziwy). Simulation Modelling Practice and Theory 18 (2010) 1515–1525 Contents lists available at ScienceDirect Simulation Modelling Practice and Theory journal homepage: www.elsevier.com/locate/simpat

GRADIS – The multiagent environment supported by graph transformations

  • Upload
    agh

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Simulation Modelling Practice and Theory 18 (2010) 1515–1525

Contents lists available at ScienceDirect

Simulation Modelling Practice and Theory

journal homepage: www.elsevier .com/ locate/s impat

GRADIS – The multiagent environment supported by graph transformations

Leszek Kotulski, Adam Se�dziwy *

Department of Automatics, AGH – University of Science and Technology, Al. Mickiewicza 30, 30-059 Kraków, Poland

a r t i c l e i n f o a b s t r a c t

Article history:Available online 23 May 2010

Keywords:Distributed graph transformationsMultiagent systemsGRADIS

1569-190X/$ - see front matter � 2010 Elsevier B.Vdoi:10.1016/j.simpat.2010.05.013

* Corresponding author.E-mail addresses: [email protected] (L. Kotulsk

The specification and simulation of a complex multiagent system needs an abstract repre-sentation that is powerful enough to describe a solved problem and sufficiently abstract tounderstand and illustrate its behavior. Complementary graphs concept enables the distri-bution of a graph representation of a system knowledge and allows its independent mod-ifications by agents, in such a way that this representation remains consistent. A problemrepresentation from the centralized and distributed point of view makes the partial graphsthe useful tool for a multiagent system designer. It also creates an environment capable ofverifying the features of multiagent systems (represented by graph metrics) by simulationof a multiagent system behavior.

� 2010 Elsevier B.V. All rights reserved.

1. Introduction

Multiagent systems are often characterized by the complex and sometimes unpredictable interactions between theirautonomous components. The inherent complexity presents a barrier to their analysis and understanding. Moreover, thereis no formal representation of a knowledge maintained by these agents. Current research concentrates either on the speci-fication of the local agents’ behavior [19] or on the specification of a communication between them [20]. The specificationand the simulation of a whole complex multiagent system behavior fail because we lack its description which would be pow-erful enough to describe the solved problem and sufficiently abstract to understand and illustrate its global behavior. Let usnote that this abstract description should enable us to represent a knowledge maintained by an agent system and to map itsparallel changes as a result of the agents’ activities. The first demand seems to be fulfilled by the graphs structures and theirtransformations. This area has been continuously and systematically developed for over 40 years [22,2,3]. There are a lot ofexamples of graph transformations applications in many areas such as visual and object oriented languages, specification oflanguages and related tools, and specification, modeling and visual design of the distributed systems. Thus graph transfor-mations seem to have powerful enough notation describing formally the various aspects of the software systems. Unfortu-nately, their common feature is a centralized graph representation. This remains in contradiction to the multiagent systemapproach because its basic features [23] imply that:

– each agent has incomplete information or capabilities for solving a problem and, thus, a limited point of view;– there is no global system control;– a data is decentralized;– computations are asynchronous.

To resolve this contradiction we have to consider the possibility of the graph distribution and parallel transformation (or,more precisely, parallel transformations made on distributed subgraphs). Complementary graph (described in Section 2) is

. All rights reserved.

i), [email protected] (A. Se�dziwy).

1516 L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525

one of the formal fundamentals of GRADIS multiagent framework [10,11] that enables a distribution of a system knowledgegraph representation and allows its independent modifications by agents in such a way that this representation remainsconsistent.

Two features of the GRADIS approach are important in practical use:

– transformation rules, being a component of an agent’s knowledge are inherited from the centralized graph representa-tion, which facilitates the work for system developers,

– the protocols assuring proper synchronization of the agents maintaining local complementary graphs representation havethe polynomial computational complexity, this warranties the efficiency of a system.

Following the FIPA [5,6] specification we assume a very simple functionality of the multiagent environment, reduced tothe message transport and broker system. This approach is similar to the ones applied in popular frameworks like JADE [9] orRetsina [21].

The introduction of a common abstract representation of a multiagent system allows us to describe some of its desiredfeatures and to check (by simulation of its agents behavior) if the local decision systems embedded into the particular agentsmake this system fulfill the desired features mentioned above. In Section 4 we show how a simple functional criterion leadsus successfully to the solution of the problem of splitting the graph into the set of complementary graphs of the given size. Amore sophisticated demand that we want the complementary graphs to fulfill concerns their shapes (when assuming geo-metric interpretation of a graph structure). This case is more complex and not so intuitive as the presented one so it was notpresented in this article.

2. Complementary graphs and GRADIS multiagent system

The GRADIS platform introduced in [10] fulfills the following assumptions:

1. The knowledge maintained by the particular agents consists of two associated components: (i) a graph structure repre-senting a portion of a given system and (ii) the graph transformation rules modeling the changes and/or interactionsinside it.

2. The portions of the knowledge held by the agents are complementary, i.e. they build together the integral description ofan entire system.

3. The local graphs transformations preserve a consistency of a global knowledge.

Designing and coordination of the distributed parallel tasks and implementing the rules are considerably more difficultthan in a centralized and sequential case. Thus our intention is that transformation rules, being a component of an agentknowledge are inherited from a system based on the centralized graph representation. The graph component of a knowledge,called a complementary (or partial) graph, is set up during the initial distribution process. The necessary step prior to a sim-ulation is formalization of the problem description.

Definition 1. Let Rv ; Re be nonempty sets of node and edge labels respectively. A ðRv ;ReÞ-graph is a triple ðV ; E;uÞwhere Vis a nonempty set, E is a subset of V � Re � V , and u : V ! Rv . V is set of nodes, E is set of edges and u is node labelingfunction. We denote the family of ðRv ;ReÞ-graphs as G.

Definition 2. The set of graphs Gi ¼ ðVi; Ei;uiÞ, for i ¼ 1;2; . . . ; k, is a decomposition of graph G to the complementary form iffthere exists a set of injective homomorphisms si : Gi ! G such that:

1. [i¼1;...;ksiðGiÞ ¼ G,2. 8i; j 2 f1; . . . ; kg : siðViÞ \ sjðVjÞ ¼ siðBorderðGiÞÞ \ sjðBorderðGjÞÞ,3. 8w 2 Vi 8v 2 Vj : 9p ¼ PathSðG;w; vÞ ) 9b 2 BorderðGiÞ : siðbÞ 2 p,4. 8i 2 f1; . . . ; kg : v 2 BorderðGiÞ () ð9w 2 Gi : w isconnectedwith vÞ or Gi ¼ fvg, where the function PathSðH;v ;wÞ

returns a set of the nodes belonging to the edges creating any acyclic connection between v and w in H and BorderðGiÞdenotes a set of all border nodes of the graph Gi.

Figs. 1 and 2 show the sample G and one of its complementary form respectively. The dotted lines in Fig. 1 mark thescopes of the partial graphs G1; G2; G3. The intersections of the areas determine the border nodes, which are marked withthe double circles in Fig. 2. The indexing convention for a complementary form of a graph assumes that an index of each non-border node consists of two numbers: the number of its parent partial graph and its unique local number within this graph.For the border nodes the index is a pair of the form ð�1; jÞ½Ai1

;Ai2;...� where j is global border node index and the subscript list

½Ai1 ;Ai2 ; . . .� contains the names of agents holding the partial graphs where the replicas of ð�1; jÞ are stored. Thus each bordernode holds an information about all its replicas so that their localizations in a distributed environment can be determinedimmediately.

Fig. 1. Centralized graph G and its decomposition schema. Dotted lines demonstrate the scopes of particular partial graphs.

Fig. 2. The sample G in its complementary form.

L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525 1517

After the initial graph decomposition and the assigning of agents to the particular partial graphs, the agents start to coop-erate; they can move borderlines between complementary graphs executing Incorporate procedure.

In Fig. 3 the result of Incorporate((�1,1),3) for the partial graphs shown in Fig. 2 is presented. (�1,1) is the index of theborder node to be incorporated, 3 is the index of partial graph which initiates the procedure (i.e. to which ð�1;1Þ will beincorporated). Note that the node ð�1;1Þ becomes a regular (non-border) node and neighbors of all its replicas get bordernodes or (if they already were) their lists of replicas are updated:

� in G1: to the node’s ð�1;2Þ½A2 ;A3 � list the agent A3 is added; node (1,3) becomes a border node, its indexation changes intoð�1;1Þ½A3 � (ð�1;1Þ index was released and may be reused now) and the A3 is added to the list of replicas,� in G2: to the node’s ð�1;2Þ½A1 ;A3 � list the agent A3 is added; for ð�1;3Þ½A3 � no update is required,� in G3: node ð�1;1Þ becomes a non-border node (changes its indexation to the local one, namely (3,5)); its two adjacent

border nodes with their replicas lists ð�1;1Þ½A1 �; ð�1;2Þ½A1 ;A2 � and the connecting edges are added.

As was mentioned earlier, we assume that for a centralized graph there is a defined set of transformation rules that enableus to modify it. The following procedure allows us to apply these rules to the complementary graphs set. Let the transfor-mation rule be formally represented as a triple P ¼ ðL;R; EÞ, where L and R are the graphs (left- and right-graph of the pro-duction, respectively) and E is some form of embedding mechanism. The left-hand side graphs should be matched to somesubgraph of G, in such a way that the graphical structure and labels are preserved; formally we will describe this matching by(iso)morphism m. Such a production can be applied to graph G whenever there is an m occurrence of L in G. P is applied byremoving mðLÞ from G, replacing it by (an isomorphic copy) of R, and finally, using embedding mechanism E to attach R to theremainder G�mðLÞ.

Fig. 3. Incorporateðð�1;1Þ;3Þ execution (see Fig. 2).

1518 L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525

The proposed idea of applying a production P : L! ðR; EÞ to a distributed graph can be described by two rules:Rule 1: Each agent decides autonomously to apply this production when three conditions are fulfilled:

1. an mth occurrence of L inside Gi can be found (Gi denotes a particular partial graph);2. none of the border nodes are removed;3. all removed edges belong to Gi.

Rule 2: When the first rule cannot be applied, the agent cooperates with the rest of the multiagent system, in the follow-ing, three steps:

1. Gathering of information: for all nodes v such that v 2 BorderðGiÞ \ VmðLÞ agent is looking for such minimal k that the graphB ¼ Neighborhoodðv;G; kÞ covers L and all nodes and edges to be removed. Neighborhoodðv ;H; kÞ is the function that for anynode v 2 VðHÞ returns a subgraph H0 # H such that v 2 VðH0Þ and for each node w 2 VðH0Þ the length of the shortest pathbetween w and v is less or equal to k.

2. Preparing an environment: all nodes belonging to B and not belonging to Gi are incorporated to the graph Gi, as a result ofa sequential execution of Incorporate procedure, made in the transactional mode.

3. Applying the production: the production P : L! ðR; EÞ can be applied in the newly created graph Gi0 according to the Rule1 (local derivation).

The concept of complementary graphs and the idea of application of the centralized graph transformation rules to thedistributed environment create the theoretical background of the GRADIS multiagent system. It was practically appliedfor both the algorithmic and algebraic graph transformation approaches (ETPL(k) graph grammar [10] and single- and dou-ble-pushout [14], respectively). In the next section we consider the problem of its efficient implementation.

3. GRADIS implementation

The efficient implementation of the GRADIS framework is related to the following questions:

� Are we able to design complementary graphs in an efficient way?� What is the complexity of the graph transformation implementation, especially in the distributed case (i.e. application of

the Rule 2)?

The first question appears because at first sight it is close to the graph’s isomorphism problem. The second one is alsonatural because the basic problem in graph transformations is the effectiveness of parsing and membership problems.

Fortunately, the designing of a set of complementary graphs is possible by the recursive splitting of the parent graph[10] according to the following schema. Let H be a subgraph of G, two partial graphs H0 and H00 are created in the followingsteps:

L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525 1519

1. Initially H0 ¼ H and H00 ¼ G n H.2. For every v 2 H such that there exists a node w 2 G n H which is a neighbor of v in G: we replicate v (denoting a copy of v

as v 0) and:� we keep v in H0 and mark it as a border node,� we attach node v 0, to H00 with all edges connecting v with G n H and also mark it as a border node,� proper references are added v and v 0, they allows us to determine the set of all replicas of v (iff v has been a border

node before this operation these references are also updated in all its previous replicas).3. Optionally, some reindexation of VH0 and VH00 can be made for optimizing local transformations. The unique addressing of

nodes in the glued graph (after the third step of the algorithm or any sequence of local graph transformations) is guar-anteed by remembering their indices as pairs of the form (local_graph_id, local_index). We also assume that, the markingof a node as a border one is associated with ascribing to it a unique index in the border nodes set (border_id is equal to�1).

Reverse algorithm of the reconstruction of G ¼ ðV ; EÞ from the set of complementary graphs, Gi, has the following form:

1. For each border node index ð�1; jÞ, only one replica, is added to V.2. All normal (not border) nodes are added to V, with their local indexation.3. Edges in E are inherited from the local graphs (if one node of an edge is a border node in the final edge its global repre-

sentative appears).4. Labeling function u is the union of ui.

The effectiveness of the graph transformation formalism in practical applications is limited due to its high computationalcomplexity in solving the parsing and membership problems. This effectiveness can be improved by representing a knowl-edge using the grammars with polynomial parsing time (e.g. ETPL(k) with Oðn2Þ parsing complexity [7]) and introducing theparallel execution paradigm. One of the more effective approaches, supported by complementary graphs concept present inthe GRADIS framework, is executing given algorithms in parallel on the local environments; such an approach is very con-venient for a system designer who does not need to take care about the problems related to the parallelism and implicit syn-chronization. It is known that parallel graph transformations enable us to solve some NP-complete problems in a polynomialtime (e.g. verification of an existence of the Hamiltonian paths in a graph [16]). On the other side one should calculate theadditional overhead caused by the communication and the synchronization in a distributed environment.

The semantics of the agents cooperation will be considered for the graph grammar production P : L! R, being applied byan agent on its local complementary graph. To apply the production P the agent X0 has to follow four steps:

� determine the set of the nodes, Vaff ðLÞ, that have to be incorporated prior to applying a production in its localenvironment,� find an occurrence of Vaff ðLÞ in the distributed environment,� incorporate Vaff ðLÞ,� apply locally production P.

The first step is finding an occurrence of L in the partial graph managed by the agent X0 and/or, in the neighboring ones(see Fig. 4). X0 does that starting from some seed node v 2 VðLÞ and making the lookup in a neighborhood of v. It is obviousthat L # B ¼ Neighborhoodðv ;G; kÞ set, where for a given L, k 6 VðLÞ is a diameter of an underlying undirected graph LH.

As the nodes of B set can be placed in other partial graphs B is computed in cooperation with the other agents: X0 sends arequest to those agents (which are denoted as Xi; i ¼ 1;2; . . . ; n) and receives required data (Bi; i ¼ 1;2; . . . ;n) in a feedback.It has to be remarked that this data is volatile, i.e. some nodes may be removed from a given partial graph after deliveringrequested data to X0. B is recovered from Bi (i ¼ 0;1; . . . ;n; B0 is X0 own data), B ¼ [iBi, where i enumerates subsequentagents. When an occurrence of L in B is found the X0 may proceed to the second step.

The part of B which is essential for the production P is B0 ¼ L \ B. At the level of particular partial graphs it is B0i ¼ L \ Bi.

Fig. 4. Production lhs graph, L, distributed over several partial graphs (dark gray) and B ¼ Neighborhoodðv ;G; kÞ (light gray).

1520 L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525

In the second step X0 has to ensure that L will be accessible for applying the production P. According to the two-phasecommit protocol semantics, in the first phase the agent X0 sends request to other agents, Xi, to block all nodes belongingto corresponding B0i. Xi blocks the nodes (agreement = yes) or rejects the request in two possible circumstances:

1. some nodes of B0i are already blocked (agreement = noaccess) or2. some nodes of B0i do not exist in a partial graph managed by Xi (agreement = noexist), e.g. they were just incorporated

by some other agents.

Second phase depends on a feedback data received by X0. It can follow one of three possible scenarios:

1. If all responses are agreement = yes then X0 sends commit request to all Xi which supply corresponding B00i ¼ B0i \ Vaff toX0 in respond.

2. At least one response is agreement = noexist then X0 sends abort request to all Xi and tries to find B ðB0Þ again.3. At least one response is agreement = noaccess then X0 sends abort request to all Xi and repeats first phase with ran-

dom delay.

In the third step, when all responses are agreement = yes, X0 shifts local graphs boundaries (by incorporating corre-sponding B00i subgraphs) in such a way that he gets able to apply production P locally. Note that after incorporatingB00i ði ¼ 1;2; . . . ; kÞ by X0, all nodes belonging to those subgraphs get internal nodes of G0 (i.e. they are not border ones)and all nodes being the neighbor ones for B00i get or remain the border nodes for G0.

In [15] we consider the complexity of determination of the graph if and only if. Formally we have to visit all the directneighbors of v0 and mark them as belonging to the layer 1; next, for each node belonging to layer j ðj < kÞ we have to visittheir direct neighbors that do not belong to the lower layers; we stop this algorithm when either we have determined themembers of the kth layer or all the nodes of the considered graph are already marked. Let us note that this algorithm ex-cludes cycles and backtracking in nodes visiting and its worst complexity is OðnÞ, where n is a number of nodes in the cen-tralized graph. The estimation of a number of messages which are necessary to assemble a distributed information is moredifficult. The agent X0 sends, in the worst case, the messages to all other agents maintaining partial graphs (we assume that arequest of coordination between a several boundary nodes belonging to G0 and some Gi can be packed in a single message);unfortunately some agent, say Xu, maintaining the node u being a direct neighbor of v0 and belonging to other partial graph,may also send a message to all other agents (except of those that maintain the paths between v0 and this node). Thus Xu maygenerate a duplicate of the request sent previously by X0. Following this reasoning, for a number of agents equaled to p theupper limitation of the number of sent messages is pðp� 1Þ � � � ðp� kþ 1Þ 2 OðpkÞ. In a case when some node v receives sev-eral duplicate requests attaching it to B, only the first is serviced. All subsequent duplicate messages are ignored. v can re-ceive not more then next p� 2 messages from the other agents (assuming that an agent remembers its local activity anddoes not send a message to the same external node twice) but this does not trigger any additional activity so the limitationfor a number of the sent messages is n � p. We consider both of these limitations because in practice they help to reduce thenumber of sent messages. The obtained Bi graphs are returned directly to the X0 agent so both actions, prepare or commit/abort phases, are limited to OðpÞ sent messages. To resume, the reliability of the Incorporateð. . .Þ and Neighborhoodð. . .Þ isimplemented by using two-commit protocols.

4. Environment self-organization – knowledge distribution

The step following the formulation of a model description is verifying the properties of a distributed graph in a multiagentenvironment. This problem covers the following issues:

� convergence of the agents behavior,� knowledge consistency,� improving the environment properties.

4.1. Convergence of the agents behavior

The final balanced workload of the agents depends on two factors: the proper distribution of knowledge and the type ofknowledge that each agents maintains. Unfortunately, these parameters strongly impact each other. In this paper we assumethat knowledge is represented as a graph and its transformation rules. Each agent knows all transformation rules (repre-sented by graph grammar productions) but possesses only a part of the global graph (i.e. particular complementary graph).Thus the agents’ workload is dependent on the kind of knowledge which can be determined after assigning the correspond-ing complementary graph, inherited in the preliminary distribution. Analyzing the complexity of graph algorithms we usu-ally consider only one parameter describing a graph, i.e. its size characterized by the number of nodes and/or edges (Oðf ðnÞ)notation). Using other graph properties (e.g. associations between node labeling and the applicability of graph transforma-tion rules) that are associated with particular problems, it is too difficult to formalize. Thus in this paper we show only that

L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525 1521

GRADIS agents are capable of self organizing in such a way that their subgraphs become almost equally sized. Let Nt param-eter be a target size of the partial graph (i.e. the particular agent tries to fit its partial graph to this size). The value of Nt de-pends on the type of graph grammar. For example, in case of ETPLðkÞ graph grammar [7,8] the membership problem is solvedwith Oðn2Þ complexity (where N is the number of nodes in the graph), thus Nt can be greater than several hundred (from theeffectiveness point of view). The single- and double-pushout graph grammars [1,4] offer the better descriptive power butthey have not so efficient parsers and solvers so Nt should not exceed several dozen elements.

The demand concerning the equally sized subgraphs may be fulfilled thanks to the presence of local cost functions as-signed to the particular partial graphs (agents). Such a problem has been considered in [12]. Let jVij denotes a number ofnodes of the partial graph Gi. A local cost function C for Gi is defined as follows:

Table 1The mo

jV j

5000

Table 2The par

jVavg

Init.

2.8

CðGiÞ ¼ðNt � jVijÞ2; jVij < Nt;

jVij � Nt; otherwise:

(

Each agent tends to minimize its cost function value. An agent may incorporate some border node, say b (executing Incorpo-

rate procedure) if a value of its local cost function C is less than the corresponding values for other agents holding the replicasof b. Additionally, we introduce the following change (compared to [12]) to an agent’s behavior: at the beginning of its actionthe agent A looks for any neighbor B, which local graph size NB satisfies the condition:

NA þ NB 6 Nt þ �;

where NA denotes the size of partial graph maintained by A and � is an acceptable deviation from Nt . If such B is found theagent A incorporates entire partial graph maintained by B. Otherwise A continues incorporating a single border node chosenaccording to the cost function criterion. This operation allows to aggregate the small distributed portions of knowledge. Theabove cooperation schema leads to the nearly equally sized partial graphs of size Nt .

The test described below demonstrates a convergence of the agents activity: the number of partial graphs reduces by 16and stabilizes; the distribution of the partial graph sizes concentrates in the range ½Nt � �;Nt þ ��.

Table 1 presents the properties of the base graph used in the test.Initially, the randomly generated base graph G ¼ ðV ; EÞ was split into partial graphs having not more than three nodes.

The range of optimal partial graph sizes was set to ½Nt � �;Nt þ ��.The agents acting according to the previously presented schema decreased the number of partial graphs 16 times. Table 2

shows the values of descriptors characterizing the set of partial graphs (average size of a partial graph and the number ofpartial graphs) in the initial and final state of MAS.

Fig. 6 shows the resultant histogram of partial graph sizes. Eighty-one percent of the partial graphs hits the range [25,35].Fig. 5 presents the sample set of partial graphs before (Fig. 5a) and after (Fig. 5b) the agents self-organization. To visualize theresult of agents activity we assign (uniquely) colors with particular partial graphs. Thus border nodes are multicolored. As itcan be seen in Fig. 5 the structure of partial graphs gets ordered. For the image clearness the computations were performedfor the base graph having jV j ¼ 1000 nodes, Nt ¼ 20.

4.2. Knowledge consistency

The consistency of the knowledge, fragmented over the agents, is ensured by two fundamentals: border nodes, being thereplicated interfaces between local environments, and the transactional nature of agents cooperation. Any agent activitybeing a superposition of Incorporate executions may be regarded as a shifting of the borders between the local environmentsmaintained by the particular agents. As it was presented in [12] a set of the complementary graphs obtained as a systemsnapshot may be easily re-composed into a base graph modeling the entire system. On the other hand, the semantics of acooperation between the agents preserves the properties of complementary graphs.

del parameters.

jEj Nt �

7252 30 5

tial graphs set evolution, jVavg j – average partial graph size, jNPGj – the number of partial graphs.

j jNPGj

Final Init. Final

26.0 3553 219

Fig. 5. The complementary graphs.

1522 L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525

4.3. Improving the environment properties

The even knowledge distribution discussed previously may be regarded as one of possible criteria of a correct systempreparation. Another possible approach assumes the knowledge partition that minimizes a number of interfaces (i.e. bordernodes) between the agents [14]. We expect that such a feature implies the minimized communication overhead.

To decrease a number of border nodes the agents need to remove from complementary graphs two types of undesirablesubstructures. Removing a border node is accomplished by requesting some other agent maintaining a replica of that node to

Fig. 6. Histogram of partial graph sizes.

L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525 1523

incorporate it. We test how removing of those subgraphs improves the structure of an entire set of complementary graphs.As the criterion we will consider the total number of border nodes.

The first undesired structure is an orphan complementary graph, containing the isolated border nodes; in such a case weshould remove all its isolated border nodes. In extreme, such graphs will be totally incorporated into another partial graphs.The second undesired structure being considered is presented in Fig. 7. Two border nodes b1; b2 are connected with oneinternal node v. Removing of b1; b2 produces one border node (formerly internal, v). Such an action decrease locally a num-ber of border nodes and should not increase its number in a global case either.

In order to check our assumptions we prepare the following experiment. We generate 100 ETPLðkÞ graphs G [7,12] of sizejVj = 10,000 nodes. Those graphs represent a centralized solution. For each of them (denoted as G) we do the following:

� G is decomposed into the set of partial graphs of size not greater than 3.� We execute 200 passes of agents cooperations to obtain the set of partial graphs having size � Nt ¼ 20 nodes. The cost

function C that impacts an agent strategy is given.� Next we execute 200 passes of agents cooperations. In that case:

– in each pass, an incorporation basing on cost function C is performed;– after each five passes removing the border nodes based on the mentioned structural criteria.

To describe the results of the experiment quantitatively we use the total number of border nodes, nBN , characterizing theset of all partial graphs.

Fig. 8 shows that the evolution of the nBN satisfies our expectations: the total number of border nodes reduces over 5times. The agent strategy based on removing undesired substructures from a partial graph leads to improving the resultsobtained in the first phase of the experiment (i.e. in the first 200 passes).

The test shows that the agents acting in two phased mode and improving only their local structural properties are able toimprove the properties (and thus a performance) of the entire environment.

It should be remarked that the cost function C is evaluated locally for all particular subgraphs so Tn value can be set sep-arately for each partial graph. Assuming that initially T ðiÞn � Tn, where i enumerates subsequent partial graphs, we can makethe initial distribution and when the system stabilizes after a few dozens iterations (Fig. 8) we can measure the agents’ work-load and decrease/increase the TðiÞn values if needed. Unfortunately, we cannot apply this in a statistical approach (i.e. by gen-eration of thousands graphs and observing their averaged properties) but it can be verified in real applications (where thetransformation rules are defined). Such a research is undertaken in Adaptive Design Process [13] and the problem of findingsubpatterns.

Fig. 7. Undesired artifact in the partial graph structure.

Fig. 8. The total number of border nodes in the partial graphs set during the agent cooperation.

1524 L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525

5. Conclusions

GRADIS platform provides the framework for distributed/parallel graph transformations. This idea is not new: it isobvious that immanent problems of graph transformation mechanisms related to the computational complexity canbe overcome by parallelization of those mechanisms. Kreowski and Kluske [16] prove that the Hamiltonian path problemcan be solved in polynomial time using graph multiset transformations. Unfortunately, it is not a solution for the P ¼ NPproblem because graph multiset transformations rely on massive parallelism. The implementation of such computationalmodel usually fails because we are unable to distribute calculations effectively over a set of computing nodes. The graphabstractions supporting parallelism like graph multiset [16] or L-system [17,18] transformations, do not have the effi-cient implementations of parsers. The second problem is the increased difficulty of designing, implementing and main-taining of distributed/parallel systems. Besides the smaller intuitiveness of parallel algorithms (in comparison tosequential ones) there also arise new problems related to the synchronization, deadlock avoidance, data and task allo-cation. The automated transformation of the sequential programs into the parallel ones is a desired solution. Let us notethat implicit synchronization of a parallel execution of transformations (inherited from the centralized graph transforma-tion) diminishes an amount of work on designing and maintenance of a system. The distributed representation of aknowledge, implemented by means of complementary graphs, seems to be very suitable for modeling the agent systems.Thus it is very important that a set of complementary graphs can be automatically transformed into the centralized formof the graph (see Section 3) what this means is that we obtain the specification of the entire multiagent system from thelocal specifications maintained by the agents.

The first area of application of this concept was an adaptive design support [13], but in this case the designing of the com-plementary graph partition was determined a priori by an architectural structure of designed house (every room was repre-sented by a separate partial graph). The more difficult task is designing the agents decisions. We can create a set of the localcriteria that impact an agent decisions on importing/exporting a part of its knowledge made to achieve a common goal (e.g.improving the properties of an environment). During this work, agents can split or deactivate themselves, so their numbermay fluctuate. It is also obvious, that the optimization of the agents number and the best knowledge distribution are com-putational tasks of high complexity (usually NP-hard or Oð2nÞ). Thus we should:

� simulate a generation of such a system (a centralized graph generation);� simulate the agents cooperation (designing of an optimal complementary graph structure);� make a statistical evaluation of the results to verify if a global objective was achieved.

An example of this idea was discussed in the last two chapters. The presented paper contains the summary of severalseparate works on the distributed transformations performed in complementary graphs environment. Gathering them to-gether allows us to propose an abstract framework supporting multiagent system simulation.

L. Kotulski, A. Se�dziwy / Simulation Modelling Practice and Theory 18 (2010) 1515–1525 1525

References

[1] A. Corradini, U. Montanari, F. Rossi, H. Ehrig, R. Heckel, M. Löwe, Algebraic approaches to graph transformation – Part I: Basic concepts and doublepushout approach, Handbook of Graph Grammars and Computing by Graph Transformations, vol. 1, Foundations, World Scientific, 1997, pp. 163–246.

[2] H. Ehrig, G. Engels, H.-J. Kreowski, G. Rozenberg, Handbook of Graph Grammars and Computing By Graph Transformation: Volume II, Applications,Languages, and Tools, World Scientific Publishing Co., River Edge, NJ, 1999.

[3] H. Ehrig, H.-J. Kreowski, U. Montanari, G. Rozenberg, Handbook of Graph Grammars and Computing By Graph Transformation: Volume III, Concurrency,Parallelism, and Distribution, World Scientific Publishing Co., River Edge, NJ, 1999.

[4] H. Ehrig, R. Heckel, M. Löwe, L. Ribeiro, A. Wagner, Algebraic approaches to graph transformation – Part II: Single pushout and comparison with doublepushout approach, in: Handbook of Graph Grammars and Computing by Graph Transformations, vol. 1, Foundations, World Scientific, 1997, pp. 247–312.

[5] FIPA: <http://www.fipa.org>.[6] FIPA ACL Specifications <http://www.fipa.org/repository/aclspecs.html>.[7] M. Flasinski, On the parsing of deterministic graph languages for syntactic pattern recognition, Pattern Recognition 26 (1) (1993).[8] M. Flasinski, Power properties of NCL graph grammars with a polynomial membership problem, Theoretical Computer Science 201 (1998) 189–231.[9] JADE: <http://jade.tilab.com/>.

[10] L. Kotulski, Gradis – multiagent environment supporting distributed graph transformations, in: LNCS, vol. 51031/2008, 2008, pp. 644–653.[11] L. Kotulski, Distributed graphs transformed by multiagent system, in: LNCS, vol. 5097/2008, 2008, pp. 1234–1242.[12] L. Kotulski, A. Se�dziwy, Agent framework for decomposing a graph into the equally sized subgraphs, in: Proceedings of the 2008 International

Conference on Foundations of Computer Science, FCS 2008, Las Vegas, NV.[13] L. Kotulski, B. Strug, Parallel graph transformation in adaptive design, in: Proceedings of the 2008 International Conference on Foundations of

Computer Science, FCS 2008, Second International Workshop Graph Computation Models, Leicester.[14] L. Kotulski, A. Se�dziwy, Structural Approach to the Designing of the Complementary Graphs in the GRADIS Agent Framework, Academic Publishing

House EXIT, Warsaw, 2009.[15] L. Kotulski, A. Se�dziwy, On the complexity of coordination of parallel graph transformations, in: Fourth International Conference on Dependability of

Computer Systems DepCoS – RELCOMEX 2009, IEEE Computer Society, Los Alamitos, CA, 2009, pp. 279–289.[16] H.J. Kreowski, S. Kluske, Graph multiset transformation as a framework for massive parallel computation, in: 4th International Conference ICGT 2008,

LNCS, vol. 5214, 2008, pp. 351–365.[17] P. Prunsinkiewicz, A. Lindenmayer, The Algorithmic Beauty of Plants, Springer-Verlag, New York, 1990.[18] A. Lindenmayer, Mathematical models for cellular interaction in development. Parts I and II, Journal of Theoretical Biology 18 (1968) 280–315.[19] M. Morandini, L. Penserini, A. Perini, Operational semantics of goal models in adaptive agents, in: Proceedings of the 8th International Conference on

Autonomous Agents and Multiagent Systems 2009, 2009, pp. 129–136.[20] W. Peng, W. Krueger, A. Grushin, P. Carlos, V. Manikonda, M. Santos, Graph-based methods for the analysis of large-scale multiagent systems, in:

Proceedings of the 8th International Conference on Autonomous Agents and Multiagent Systems 2009, 2009, pp. 545–552.[21] Retsina: <http://www.cs.cmu.edu/softagents/retsina.html>.[22] G. Rozenberg, Handbook of Graph Grammars and Computing By Graph Transformation: Volume I, Foundations, World Scientific Publishing Co., River

Edge, NJ, 1997.[23] K.P. Sycara, Multiagent system, AI Magazine (1998) 79–92.