XIII Congreso Espa˜ nol en Metaheur´ ısticas y Algoritmos Evolutivos y Bioinspirados 527 GRASP with Path Relinking for the Constrained Incremental Graph Drawing Problem A. Mart´ ınez-Gavara Dept. Estad´ ıstica i Inv. Operativa Universitat de Val` encia Val` encia, Espa˜ na gavara@uv.es A. Napoletano Dept. Mathematics and Applications University of Napoli Federico II Napoli, Italy antonio.napoletano2@unina.it P. Festa Dept. Mathematics and Applications University of Napoli Federico II Napoli, Italy paola.festa@unina.it T. Pastore Dept. Mathematics and Applications University of Napoli Federico II Napoli, Italy tommaso.pastore@unina.it R. Mart´ ı Dept. Estad´ stica i Inv. Operativa Universitat de Val` encia Val` encia, Espa˜ na rafael.marti@uv.es Abstract—Graph Drawing is a well-established area in Com- puter Science, with applications from scheduling to software diagrams. The main quality desired for drawings is readability, and edge crossing minimization is a well-recognized method for a good representation of them. This work focuses in incremental graph drawing problems, with the aim to minimize the number of edge crossings while satisfying some constraints to preserve the absolute position of the vertices in previous drawings. We propose a mathematical model and a GRASP (Greedy Randomized Adap- tive Search Procedure) with PR (Path Relinking) methodology to solve this problem. Finally, we compare our methodology with CPLEX and heuristic solutions obtained by a well-known black- box solver, LocalSolver. Index Terms—heuristics, graph drawing, path relinking I. I NTRODUCTION Graph Drawing is a relevant topic of research in areas such as workflow visualization, database modeling, bioinfomatics and decision diagrams. The difficulty lies in getting readable informations from systems represented by graphs. See, for example, Kaufmann and Wagner [4] and Di Battista [1] for a throughly survey in graph drawing. The edge-crossing minimization criterion is one of the most common to obtain a readable drawing. The problem of minimizing the number of crossings is NP-complete. In this work we consider hierarchical graphs, this is not a limitation since there exists several methodologies to convert any directed acyclic graph (DAG) into a layered graph. The Hierarchical Directed Acyclical Graph (HDAG) representation is done by setting all the vertices in layers, and all the edges pointing in the same direction. The most well-known method to obtain a good representation of a graph is the Sugiyama’s procedure [9], which has become a standard in the field. We focus on minimizing the number of edge crossings in incremental graph drawings. The goal is to preserve the mental This work has been partially supported by the Spanish Ministerio de Econom´ ıa y Competitividad with grant ref. TIN2015-65460-C02. map of the user over successive drawings. In this way, we consider a new model adding constraints on both the relative ( [7]) and the absolute position of the original vertices ( [1] in the context of orthogonal graphs). In this work, we propose a new mathematical programing formulation and a GRASP (Greedy Randomized Adaptive Search Procedure) with PR (Path Relinking) method. We adapt the well-known Local Solver black-box optimizer to solve this problem. Finally, we compare our heuristic with CPLEX and Local Solver, we have verified that GRASP+PR is able to obtain a fraction of the optimal so- lutions. II. MATHEMATICAL PROGRAMING MODEL A hierarchical graph H =(G, p, L) is defined as a graph G =(V,E) where V and E represent the sets of vertices and edges, respectively, p is the number of layers, and L : V →{1, 2,...,p} is a function that indicates the layer where a vertex v ∈ V resides. Let V t be the set of vertices in layer t, and let E t be the set of edges from V t to V t+1 , with n t = |V t |. The problem of minimizing edge-crossing is well-known in graph drawing [1] and, in the context of hierarchical graphs, may be formulated as the problem of finding the optimal ordering in each layer. A drawing D of a hierarchical graph H is the pair (H, Π) where Π is the set {π 1 ,...,π p }, with π t establishing the ordering of the vertices in the layer t. We define as C (D) the total number of edge crossings in drawing D. From an original hierarchical graph H =(G, p, L) and its drawing D =(H, Π 0 ), we can consider the addition of some vertices ˆ V and edges ˆ E obtaining an incremental graph IH = (IV,IE,p,L), where IV = V ∪ ˆ V and IE = E ∪ ˆ E, p is the number of layers and m t is the number of vertices in the incremental graph in layer t.