INVESTIGATING THE CANDIDATE PAIR GENERATION OF THE VF2 ALGORITHM Peter Feher and Laszlo Lengyel ´ ´ ´ ´ Department of Automation and Applied Informatics Budapest University of Technology and Economics Budapest, Hungary email: {feher.peter, lengyel}@aut.bme.hu ABSTRACT Recently, model transformation approaches are becoming increasingly popular; therefore their efficiency and us- ability are key factors and require further investigation. These approaches are regularly used in software engi- neering, most often as part of the model-driven develop- ment methodology. In the case of the graph rewriting- based model transformation approaches, the applied graph matching algorithm greatly determines the efficiency of the transformation approach. The matching algorithm is used to identify sub-graph isomorphism between the transfor- mation rules and the host graph. A widely applied graph matching algorithm is the VF2 algorithm. In this paper we briefly introduce the original VF2 algorithm – specifically, its method – which manages the next possible node pairs. We present a new approach, which increases the efficiency of choosing these node pairs. We also introduce an order- ing function, which increases the performance even further. Finally, the effects of these new approaches are presented based on our experimental results. KEY WORDS Graph matching, Graph rewriting, Graph transformation, Optimization, Pattern matching, Software algorithms, VF2 algorithm 1 Introduction Currently, the model-driven software engineering is a pop- ular approach in the field of software development. It is of- ten based on model transformation, which is used through- out a wide spectrum of the development phases. A few rep- resentative objectives, including examples, are as follows: (i) to create a higher level of abstraction in the develop- ment phase through the mapping of platform-independent models to platform-specific models, e.g., to increase the reusability and maintenance of the systems and testing in smart home systems [1]. (ii) Transforming models be- tween different domains, e.g., transforming a system into a Petri-net model to perform certain analysis. (iii) Refac- toring purposes, i.e. improving model attributes and struc- ture, while preserving the semantic meaning. Since model transformations appear in numerous scenarios, there is an obvious need for tools and techniques regarding their op- erational support. There are research groups concentrating on how to express model transformations and how they can be supported appropriately using different tools [9]. Other research results [5] [8] analyze the different development phases of a model transformation and deal with their speci- fication and implementation [6]. This paper focuses on the efficiency of the model transformation process. Graphs are commonly used to represent a variety of data structures. By attributing the nodes and edges, graphs are effectively used in modeling different states of a sys- tem, solving traffic problems, representing relationship be- tween the different parts of the software and/or modeling the structure of chemical elements. Therefore, graphs have gained significant attention within the scientific commu- nity. There are several algorithms to identify graph- subgraph isomorphisms, which methods are essential parts of the graph rewriting-based model transformation ap- proaches. Since it is already proven that subgraph iso- morphism is NP complete [11], the different approaches at- tempt to reduce the computational complexity. Therefore, some algorithms define restrictions towards the structure of the graphs, others attempt to reduce the searching space at each iteration. Currently the VF2 algorithm [2] is a popular approach to locate complete or graph-subgraph isomorphisms. Ex- perimental results have shown their efficiency, particularly regarding large graphs [7]. However, in the case of model transformation approaches, the performance of the pattern matching algorithms has a significant influence on the en- tire transformation process. Therefore, it remains essential to increase the performance of the matching. The goal of the presented approach is to increase the efficiency of the development and quality of the software artifacts. The rest of this paper is organized as follows: Sec- tion 2 includes the introduction of the VF2 algorithm. Sec- tion 3 provides a method to increase the performance of the VF2 algorithm. Section 4 presents a supportive order- ing function. Section 5 introduces our experimental results. Finally, concluding remarks are elaborated. Proceedings of the IASTED International Conference Software Engineering (SE 2013) February 11 - 13, 2013, Innsbruck, Austria DOI: 10.2316/P.2013.796-010 814