Removing Node and Edge Overlapping in Graph ... - Semantic Scholar

2 downloads 0 Views 138KB Size Report
Graph layout problems such as node and edge overlap- ping occur widely in many ...... [3] A. Davenport, E. Tsang, C. Wang, and K. Zhu. GENET: A connectionist ...
Removing Node and Edge Overlapping in Graph Layouts by A Modified EGENET Solver Vincent Tam Department of Computer Science, School of Computing, National University of Singapore, Lower Kent Ridge Road, Singapore 119260. [email protected]

Abstract Graph layout problems such as node and edge overlapping occur widely in many industrial computer-aided design applications. Usually, these problems are handled in an ad hoc manner by some specially designed algorithms. GENET and its extended model EGENET are local search methods used to solve constraint satisfaction problems such as the car-sequencing problems efficiently. Both models use the min-conflict heuristic to update every finite-domain variable for finding local minima, and then apply heuristic learning rule(s) to escape the local minima not representing solution(s). In the past, few researchers have ever considered to apply any local search method like the EGENET approach to solve graph layout problems. In this paper, we consider how to modify the original EGENET model for solving the graph layout problems formulated as continuous constrained optimization problems. The empirical evaluation of different approaches on the graph layout problems demonstrated some advantages of our modified EGENET approach, which requires further investigation. More importantly, this interesting proposal opens up numerous opportunities for exploring the other possible ways to modify the original EGENET model, or using the other local search methods to solve these graph layout problems.

1 Introduction A constraint satisfaction problem (CSP)[12] involves a finite set Z of variables X1 ; : : : ; Xn , each with a domain Di of possible values, and a finite (possibly empty) set C of constraints. A unary constraint i 2 C restricts the values that the variable Xi can take from Di . A binary constraint

ij 2 C restricts the combinations of values taken from Di  Dj for both variables Xi and Xj . A binary CSP consists of only unary and binary constraints. A general CSP

involves general constraints which limit the combinations of discrete values for any number of finite-domain variables. Strictly speaking, a (finite) CSP denotes a CSP with finite domains of discrete values while a continuous CSP refers to a CSP with infinite domains of continuous values. Given a CSP (of any type), the challenge is to find a complete and consistent valuation (X1 = v1 ; : : : ; Xn = vn ), denoting the simultaneous assignment of values v1 2 D1 ; : : : ; vn 2 Dn , to all the variables X1 ; : : : ; Xn in Z , which does not violate any constraint in C . For compactness, we may also use a vector v^ = hv1 ; : : : ; vn i to denote a complete valuation. In the case of a continuous CSP, each domain Di is usually represented by a range li : : : ui denoting the lower bound li and the upper bound ui , and vi denotes any real number lying in that range. According to the different nature of their underlying domains, many complex real-world industrial applications such as resource allocation[12] and scheduling[1] can be formulated either as finite or continuous CSPs. Clearly, we have to employ different search techniques to handle these radically different types of CSPs. There are many approaches to solve finite CSPs. Enumerative search methods such as chronological backtracking[12] can be slow on solving many real-life large-scale or difficult CSPs. On the other hand, stochastic search methods such as artificial neural networks (ANNs) [1, 2, 3], evolutionary algorithms[4] and simulated annealing[6] can be more efficient in solving certain real-life examples[3, 15] of finite CSPs. Among the stochastic search methods, GENET[14] and its extended model EGENET[7] are the min-conflict heuristic (MCH)[9] based ANNs which can solve some difficult finite CSPs such as a set of graph coloring problems[6] efficiently. GENET was originally designed to solve binary CSPs, which was later extended as EGENET for handling general CSPs. In principle, both GENET and EGENET transform the original finite CSP into a discrete unconstrained m v) = Ui (^ v ), optimization problem as minv^2Dn g (^ i=1

P

where Dn = D1  : : :  Dn is the Cartesian product of the finite domains for all the n variables, m is the total v ) denotes the cost function for number of constraints, Ui (^ each constraint Ci in the CSP with respect to the current valuation v^. Ui (^ v ) equals 0 when v ^ satisfies Ci . Otherwise, it returns any positive integer. In this formulation 1, the goal v) is to minimize the output of the objective function g (^ depending on the total number of violated constraints and the weights associated with these constraints. Clearly, the global minimum of g (^ v ) is 0 when v ^, a solution to the CSP, does not violate any constraint in C . To achieve this goal, both GENET and EGENET use the MCH to minimize a local objective function f (^ v ; X ) for every variable X v; X ) = in the CSP, that is minv^2Dn f (^ 8Ci 2CX Ui (^v ) where CX represents the set of constraints involving X , until the search converges to certain local/global minima. In other words, the MCH is used to assign a value, which is locally minimum in terms of constraint violations, to each variable in the CSP so as to hopefully reach the global minimum. When there are several local minima (ties) in terms of constraint violations, a value will be randomly selected among these ties to allow sideways move2 in the search. When the (E)GENET search stays at some local minima not representing a solution, a heuristic learning rule will be applied to escape from these local minima. Based on the (E)GENET approach, Tsang et al. [13] devised the Guided Local Search (GLS) scheme to efficiently solve some real-world discrete constrained optimization problems[12]. Besides discrete constrained optimization problems, continuous constrained optimization problems (CCOPs) also cover a wide range of real-life applications[10, 8]. An example is the layout adjustment problem widely occurred in many graph drawing tools. Layout adjustment is required when the originally point-based nodes are sometimes expanded to rectangular boxes for labelling, which may result in some node overlapping. When we view this problem under the framework of constrained optimization, the constraint satisfaction part is to modify an initial graph layout with the original sizes and positions, that is the x- and ycoordinates of the center, of the nodes represented as rectangular boxes so as to remove node overlapping. In addition, there are some optimization criteria for consideration in different practical applications. For instance, in the static context, layout adjustment algorithms should consider the minimization of the area of the resulting layout as well as the removal of node overlapping at the same time. In the dynamic context, when we follow Misue et al.’s proposal [10]

P

1 Note that our formulation is in fact an extension of the discrete unconstrained formulation [11] of the boolean satisfiability (SAT) problems to CSPs. 2 In the original GENET mode, when the ties contain the previously selected value, this already selected value will be chosen to reduce the frequency of sideways move so as to promote stable operations.

to minimize change to the mental map by preserving the graph’s orthogonal ordering, the layout adjustment algorithm should try to place nodes as closely as possible to their original positions while removing node overlapping. Furthermore, when we consider the more complicated case where the nodes are connected up with edges, the resulting layout may often have a lot of edge overlapping after the application of most specific algorithms designed to remove node overlapping only. Surprisingly, there has been very little work in the past on layout adjustment and mental map preservation. The most closely related papers are that of Eades et al [5] in which mental map was proposed for the first time and orthogonal ordering, proximity relations and topology were given as three criteria, and that of Misue et al [10], which provides a force-directed algorithm called the force scan algorithm to perform dynamic graph layout adjustment. Since node/edge overlapping essentially represents local inconsistency between nodes/edges in a graph layout, local search methods seem to be an attractive approach to resolve all these local conflicts quickly by trying many different local minima. To allow users to flexibly add constraints to depict the semantics of some complicated graphs, we firstly formulate graph layout problems in both static and dynamic contexts as CCOPs. Then, we consider an interesting proposal to modify the EGENET solver originally designed for solving finite CSPs to solve these graph layout problems as example CCOPs. Here, our work represents the first attempt, as we know, to investigate how a local search based constraint solver can be used to automate graph layout adjustment. In addition, our proposal opens up myriad of opportunities for investigating the numerous possible ways to modify the original EGENET model or other local search methods for solving the graph layout problems as well as other continuous constrained optimization problems. This paper is organized as follows. Section 2 introduces the original EGENET model. Then, it discusses how to modify the EGENET model to handle both the static and dynamic layout problems as continuous constrained optimization problems. We give empirical evaluation of our modified EGENET solver against some well-known graph layout adjustment techniques on a set of arbitrary graph layout problems to demonstrate the efficiency and effectiveness of our proposal in section 3. Lastly, we summarize and conclude our work in section 4.

2 Modifying the EGENET Solver to Handle Graph Layout Problems In this section, we are going to investigate how the EGENET solver as an instance of efficient local search methods can be modified for solving the layout adjustment problems as example continuous constrained optimization

problems (CCOPs). For our subsequent discussion, we would firstly review the original GENET and EGENET model and their uses in solving discrete constrained optimization problems. Then, we study how to modify the original EGENET to handle continuous constrained problems (without optimization). Lastly, we discuss how the modified EGENET can be used to solve the layout adjustment problems formulated as CCOPs for both static and dynamic cases. Up to our knowledge, this work represents the first attempt to investigate how a local search method[1, 2] like EGENET can be used to solve graph layout problems. In addition, our proposed techniques can be useful for solving other real-life instances of COOPs.

2.1 The Original EGENET Solver GENET [14] is an artificial neural network, based on the min-conflict heuristic (MCH), for solving general CSPs with binary constraints. The MCH is to assign a value causing the minimum number of conflicts to each variable so as to quickly find the local minima in the search space. In the GENET model, a value u in the domain of variable X is said to be “in conflict” with another value v in the domain of variable Y when (X = u; Y = v ) violates certain binary constraint in a CSP. GENET has had remarkable success in solving certain hard binary CSPs such as hard graph colouring problems [6]. Figure 1(a) shows the constraint network of a binary CSP with three variables X; Y and Z , each of which has a domain of f1; 2; 3g, and a set of constraints C = fX < Y ; X 6= Z; Y < Z g. Figure 1(b) shows the corresponding GENET network structure. The first cluster of three nodes denotes the three possible values for variable X . And an inhibitory connection with an initial penalty 1 is constructed between nodes with conflicting values.

conflict is extended to each individual general constraint. Thus, a conflict simply means a constraint violation 3 in EGENET. EGENET has also been successfully applied to solve non-binary CSPs such as the car-sequencing problems and cryptarithmetic problems in an efficient manner [7]. Both GENET and EGENET use a MCH-based state update rule and a heuristic learning rule to minimize and penalize the cost function Ui (^ v ) until it finds a solution v ^s . Initially, a complete and random variable assignment v^0 is generated. Then, the network executes a convergence procedure as follows. Each variable is asynchronously updated by the MCH-based state update rule in each convergence cycle. When there is no change in any value assigned to the variables, the network is trapped in a local minima. If the local minimum does not represents a solution, a heuristic learning rule, is used to update the penalty function Ui (^ v) for any violated constraint Ci in the CSP so as to help the network escape from these local minima. The network convergence procedure iterates until a solution v^s is found or a predetermined resource limit is exceeded.

2.2 Modifying the EGENET Solver to Remove Node and Edge Overlapping

Figure 1. The constraint network and the GENET network of an example CSP.

Node or edge overlapping essentially represents local conflicts which may easily be solved by local search methods[1, 2] such as EGENET. However, the original EGENET solver can only support the solving of general constraints over finite domains. Therefore, to solve the layout adjustment problems with the EGENET approach, we have to consider how to modify the original EGENET solver to handle node or edge overlapping as a continuous constrained problem. Besides, there are many other reallife applications [8, 11] also involving constraints on real numbers. To handle node or edge overlapping problem as a continuous constrained problem, we have to decide how to represent the real-number domain of each variable in a EGENET network. For the original EGENET network, the domain of each variable in a CSP consists of only a finite number of elements which are usually denoted by integers. Therefore, we are free to store all the integers (when the integers are not consecutive, or the domain size is small) or just the lower and upper bounds whenever appropriate to denote the domain of each variable in the original EGENET network. But for continuous constrained optimization problems, we propose to use the range l::u where l and u are real numbers used to denote the lower and upper bounds of the range for

Lee et. al. [7] extended GENET to EGENET with a generic representation scheme for handling both binary and non-binary constraints. In EGENET, the meaning of a

3 Therefore, given a binary CSP, the number of conflicts can be different in both the GENET and EGENET models. However, we can define a function to combine the number of constraint violations for each individual tuple (X = u; Y = v ) for all the binary constraints defined on the variables X and Y in EGENET, then we will have the same number of conflicts in both models.

{1,2,3} X X < Y

X

Y

= 6

Z

Z

X

Y

Z

1

1

1

2

2

2

3

3

3

Y < Z

{1,2,3}

{1,2,3}

(a) The constraint network of a CSP

(b) The GENET network of the CSP

the real-number domain of each variable in the modified EGENET network. In particular, when we focus on handling the node overlapping problem, the position of each label (as a rectangular box) in a graph layout is represented by the x- and ycoordinates of its center, which will then be represented by two consecutive 4 variable in the modified EGENET network. The upper and lower bounds of each variable X for the x-direction are initialized as X0  maxx where X0 denotes the input value of X as given by the initial layout, and maxx is the maximum overlapping distance of all the labels in the initial layout for the x-direction. Similarly, the bounds of each variable Y for the y-direction are initialized as Y0  maxy . Then, given the flexible representation scheme for any general constraint in the EGENET model, it is straightforward to define a non-overlap constraint as a disjunctive constraint in the EGENET network to ensure that there will be no overlapping between any two labels i and j as non-overlap(i; j ) : jXi Xj j  (wi + wj )=2 _ jYi Yj j  (hi + hj )=2, where _ denotes the logical OR, Xi and Xj are the EGENET variables for the labels i and j for the x-direction, and both wi and wj are the width of the labels i and j . Similarly, Yi and Yj are the EGENET variables for the labels i and j for the ydirection and both hi and hj are the height of the labels i and j . Figure 2(a) is an initial layout with two overlapping labels n1 and n2 for the layout adjustment problem. Figure 2(b) shows how the problem is represented in the modified EGENET network. The EGENET variables X1 and Y1 are used to represent the x- and y-coordinates of the center of the label n1 in the resulting layout, whereas X2 and Y2 are used to represent the coordinates for n2 in the EGENET network respectively. The domains of these EGENET variables are initialized according to their initial positions in each of the x- or y-direction and their maximum overlapping distance in that direction as xi  maxx or yi  maxy respectively. To ensure there will be no overlapping between the labels n1 and n2 in the resulting layout, the no-overlap(n1 ; n2 ) constraint, represented by (a =

j

X1

(h1 + h2 )=2)

X2

j(

w1

+

w2 )=2)

_(

b

=

j

Y1

Y2

j

in the figure, is added into the EGENET network to connect all the involved variables X1 ; Y1 ; X2 and Y2 appropriately. This example demonstrates an advantage of using the EGENET approach to solve the layout adjustment problems : it is, in general, fairly straightforward to represent the constraints involved in these graph layout problems or other similar real-life optimization problems in the EGENET network. 4 We choose such representation scheme since it is straightforward to encode the layout adjustment problem in this way. In addition, it simplifies the EGENET computation. Nevertheless, we can always define some new variable updating functions to treat two consecutive variables as a single object so as to move each label in the layout for both x- and y-directions at the same time.

y

non-overlap(n1 ; n2 ) : a _ b

w1 h1

* n1 : (x1 ; y1 ) h2

maxy max *xn2 : (x2 ; y2 )

b

a

w2

x (a) An example graph layout with

X1

Y1

X2

Y2

(b) The modified EGENET network

node overlapping

Figure 2. An example graph layout and the corresponding modified EGENET network.

Since the original EGENET variable updating function, based on the min-conflict heuristic, assumes a finite number of possible values in the domain of each variable, to update a continuous variable in the modified EGENET network, we need to treat the domain of each continuous variable represented as a range l : : : u as a set with finite number of elements bounded by the values l and u only. In the other word, we are sampling the domain of each continuous variable by trying a finite number of different elements in the range l : : : u when updating each variable in the modified EGENET network. The number of elements we are trying in each update is called the domain sampling size. For simplicity, we set the initial domain sampling size as 10 for most continuous optimization problems which can be changed during the EGENET computation, for instance we can double the domain sampling size each time a solution is found. Clearly, although we are now handling real numbers as possible values for each variable, the variable updating function in the modified EGENET is very similar to the original EGENET variable updating function [7] except that we define a new variable ordering strategy which updates the variables for the one direction by a random ordering before or after updating the variables for another direction. In a similar manner to handle node overlapping, we define a non-edge-overlap(ei; ej ) constraint in the EGENET network to ensure no edge overlapping between any two edges ei and ej . Since we restrict that any edge in a layout must be a straight line joining the centers of two connecting labels, we can easily enforce the non-edge-overlap(ei; ej ) constraint by ensuring that there does not exist an intersection point (ox ; oy ) between the two edges (lines) ei and ej , which satisfies the following equation : oy mi  ox ki = oy m j  ox kj , where mi and mj are the slopes of the two edges, and ki and kj are their y-intercepts. Whenever any non-edge-overlap(ei; ej ) constraint is violated, we will try to keep on moving the nodes connecting to ei and ej around until no intersection point is detected. Clearly, this

simple approach may significantly slow down the performance of the modified EGENET for large graphs with many edges. However, it should be noted that these edge overlapping problems are in fact very difficult problems which have seldom or never been tackled by any researcher. Therefore, our proposal at least represents a feasible solution for the average graphs. Also, in the future, we may want to investigate more sophisticated algorithm to handle these edge overlapping problems.

2.3 Modifying the EGENET Solver for Achieving Optimization in Graph Layouts In this paper, we are interested to solve the layout adjustment problem as a continuous constrained optimization problem. Thus, to solve this problem with the EGENET approach, we have to firstly consider a general optimization algorithm, based on the modified EGENET solver, for solving any continuous constrained optimization problem. Then, we will discuss how to adapt this general optimization algorithm to solve the layout adjustment problem in both static and dynamic context. In section 3, we will compare the performance of this EGENET-based optimization algorithm with the other proposals on solving a set of graph layout problems. To handle a continuous constrained optimization problem using the modified EGENET solver, we devise a general optimization algorithm called EGENET-opt. Figure 3 gives the pseudo-code for EGENET-opt. The algorithm EGENET-opt(DS Z; E V ars; ost()) initialize all variables 2 E V ars initialize Best and opt repeat repeat Z

:=

var order (E V ars)

foreach v 2 Z update v using the modified EGENET solver endforeach until (no update for all v 2 Z ) if (E V ars represents a solution) revise bounds(E V ars) update Best and opt accordingly endif penalize ctr(E V ars) penalize label(E V ars) until (stopping criterion()) return hBest; opti Figure 3. A EGENET-based Optimization Algorithm (EGENET-opt) for Handling CCOPs

EGENET-opt takes the domain sampling size DS Z , the set

of EGENET variables and the cost function ost() as inputs, and returns a tuple with the best solution Best and the optimal solution cost opt. The basic idea is similar to that of GLS [13]. First, we initialize all the EGENET variables in the set E V ars. In the case of graph layout problems, we simply initialize each EGENET variable to its value in the initial layout. Then, we use the var order function to order the EGENET variables in E V ars for updating, and invokes the modified EGENET solver as a local search method to find a local minimum representing the best values returned from a predefined augmented cost function, which usually satisfies most of the constraints defined between the continuous variables in the optimization problem. When the local minimum represents a solution, EGENET-opt invokes the function revise bounds to try to revise the bounds for the domains of the EGENET variables. Then, it computes the solution cost according to the cost function, and updates Best and opt when the cost of the current solution is smaller than opt. To modify the augmented cost function, EGENET-opt invokes penalize ctr(E V ars), which is basically the same as the original EGENET heuristic learning mechanism, to penalize any violated constraint with respect to the current variable assignments in E V ars. Similarly, EGENET-opt invokes penalize label(E V ars) to increase the label cost for each label in E V ars. The algorithm iterates until the function stopping criterion detects that a predefined stopping criterion is fulfilled, and therefore returns true. As for the graph layout problem, stopping criterion will return true when a predetermined resource is exhausted, or when the cost of the current solution is worse or equal to the previous solution. E V ars

Clearly, revise bounds may help to greatly increase the search efficiency of EGENET-opt when the domain sizes of the variables can be drastically shrunk by successive convergence to local minima. In particular, when we consider the layout adjustment problem, the upper or lower bound for the domain of a EGENET variable will be revised when the current value assigned to that variable in the solution is found to be smaller than the upper bound, or greater than the lower bound for that variable. When this current value equals to its original value in the initial layout, the bounds will be unchanged. After all, the efficiency of using EGENET-opt to solve a continuous constrained optimization problem, and the quality of the best solution found by EGENET-opt depends largely on how we define the augmented cost function, and how we modify this cost function by the penalize ctr and penalize label functions in an appropriate manner. For example, when we consider the graph layout problem, if the augmented cost function is biased towards the penalty for constraint violation, that is node overlapping, then EGENET-opt may take a longer time, or even

fail, to return a good optimal solution5 . On the other hand, when the augmented cost function is biased towards the solution cost, then EGENET-opt may always fail to even find a solution satisfying all the non-overlap constraints defined in a graph layout problem. In the following paragraphs, we are going to discuss how we define the solution cost, the augment cost function and the related penalty functions for both the static and dynamic cases respectively. The Static Graph Layout Problem The static layout problem is to minimize the area of the resulting layout with respect to the center of the initial layout. Thus, the solution cost for the static layout problem is similar to the objective function defined in our first proposal. k That is ost(fX1 ; Y1 ; : : : ; Xk ; Yk g) = i=1 ((Xi Lx )2 + y 2 (Yi L ) ), where k denotes the total number of nodes in the initial layout. Lx and Ly are the x- and y-coordinates of the center of the initial layout, whereas Xi and Yi denote the x- and y-coordinates of the nodes in the resulting layout. Since the quantity (Xi Lx )2 or (Yi Ly )2 (usually in the order of 100 or 1000 for the static layout problems) is always much larger than the penalty value (usually less than 10) for constraint violations, to avoid biasing towards the solution cost, we have to normalize this quantity by its maximum squared distance from the center of the initial layout before integrating it into the augmented cost function respectively. That is, we define a normalized distance cost function norm x ost(Xi ) for any EGENET variable Xi in the x-direction as norm x ost(Xi ) = (Xi x 2 x 2 x 2 L ) =max((Xi L ) ), where max((Xi L ) ) is a function returning the maximum value for all the possible values of (Xi Lx )2 with respect to the variable Xi . Clearly, the value returned by norm x ost(Xi ) is any real number in the range of [0 : : : 1℄. Similarly, a normalized distance cost function norm y ost(Yi ) is defined for each EGENET variable Yi . Accordingly, we define the augmented cost function f (Xi ) for a EGENET variable Xi as the sum of the penalty for constraint violations, and its norm v) + malized distance cost function as f (Xi ) = j =1 Uj (^ norm x ost(Xi ), where m denotes the total number of constraints in the problem. v^ represents the current variable assignments, and the function Uj (^ v ), as defined in Section 1, returns the penalty value for the constraint Cj with respect to v^. When a local minimum is found, the penalty function penalize label increases the label cost for each label according to its normalized distance cost function. And the penalize ctr function simply increases the penalty of a violating tuple in any constraint by 1 as in the original EGENET model. The Dynamic Graph Layout Problem Given the flexibility of the EGENET approach, the dy-

P

P

5 Here, we mean a solution with its cost close enough to the globally optimal cost of the optimization problem.

namic layout problem can be handled in a similar fashion as the static layout problem. First, we define the solution cost for our proposed optimization algorithm EGENET-opt to handle the dynamic layout problem as

f

ost( X1 ; Y1 ; : : : ; Xk ; Yk

0 2

) ),

g) = P

k i=1

((Xi

0 2

Xi

) + (Yi

where k denotes the total number of nodes in the initial layout. Xi0 and Yi0 are the original x- and ycoordinates of node i the initial layout, whereas Xi and Yi are the x- and y-coordinates of node i in the resulting layout. Here again, the distance measure (Xi Xi0 )2 or 0 2 (Yi Yi ) with respect to its original position in the initial layout is comparatively much larger than the penalty cost. Thus, we have to normalize each of them accordingly. For a EGENET variable Xi for the x-direction, we define its normalized distance cost function norm x ost(Xi ) as 0 2 0 2 norm x ost(Xi ) = (Xi Xi ) =max((Xi Xi ) ), where 0 2 max((Xi Xi ) ) returns the maximum possible value for the distance measure (Xi Xi0 )2 . Clearly, the augmented cost function f (Xi ) for any EGENET variable Xi in our proposed EGENET-based optimization scheme to handle the dynamic layout problem is the same as that of the static case. Accordingly, the constraint and label penalty functions modify the augmented cost function in a similar fashion as those of the static case for solving the dynamic layout problem. Yi

3 Empirical Evaluation In this section, we will give an empirical evaluation of our modified EGENET approach on some graph layout problems with node or edge overlapping. In particular, we compare the performance of our modified EGENET against some well-known layout adjustment techniques such as the Scaling Algorithm (SCALE) and the Force Scan Algorithm (FSA) of Misue et al [10] to remove node overlapping on a number of arbitrary static and dynamic layout problems. SCALE represents a simple yet powerful approach which simply multiplies the x- and y-coordinates of all the nodes in the initial graph layout by a scaling factor to remove node overlapping. The advantage of this simple approach is that the users’ mental map of the diagram is always preserved since the final layout is just a scaled version. FSA is a forcedirected algorithm which only moves the affected nodes to a predetermined distance (according to the generated pushing force) in either the x- or y-direction when node overlapping is detected. For the modified EGENET solver, the resource limit for finding each solution is 1000. And the solver will halt whenever the resource used is greater than 1000, or the cost of the solution found is worse than that of the previous one. All the solvers are implemented in C, and compiled by the GCC compiler version 2:7:3 on Linux. All benchmarks are collected on a Pentium PC running at 155M hz . Figure 4 shows an example Graph 1 with 14 nodes. The

(a) Graph 1, general

(b) Graph 1 with box nodes

Gph. 1 2 3 Gph. 1 2 3

(c) SCALE

(d) FSA

Static cases - time (cost) SCALE FSA Mod. EGENET 0.000 (220114) 0.020 (392240) 0.423 (121508) 0.010 (21614) 0.000 (13667) 0.033 (10389) 0.010 (170040) 0.000 (103909) 0.028 (62067) Dynamic cases - time (cost) SCALE FSA Mod. EGENET 0.010 (44135) 0.020 (204298) 4.959 (22145) 0.000 (3798) 0.000 (1960) 0.094 (594) 0.010 (16177) 0.000 (6272) 0.037 (784)

Table 1. A comparison of the CPU time and cost of SCALE, FSA and Modified EGENET on the arbitrary static and dynamic layout problems.

as discussed in Section 2 for each adjusted layout in the (f) Modified EGENET (dyn.) static or dynamic context. In general, the modified EGENET approach always find the best layout with the minimal cost, as compared to the Figure 4. Example Graph 1. other solvers, in a reasonable period of time for both static and dynamic cases as shown in Table 1. This demonstrates that local search methods are attractive approach to haninitial layout of Graph 1 as shown in Figure 4(a) is nice dle these graph layout problems as example CCOPs. For with evenly positioned nodes and uniform length edges. the static layout problems, the modified EGENET solver Nonetheless, the layout looks terrible in Figure 4(b) when spent, on the average, 3 5 times of the timings required its nodes are instead boxes of various size. Thus, some adfor SCALE or FSA due to the more sophisticated compujustment of the layout is necessary to remove the node overtation involved to find the better solutions/layouts. As for lapping. Figure 4(c) and Figure 4(d) give the adjusted laythe first static case which involves lots of node overlapping, out of Figure 4(b) by the standard techniques SCALE and the modified EGENET solver spent about 20 times of the FSA respectively, where all node overlapping are successtiming for FSA and SCALE. Similarly, as for the dynamic fully removed and the layout is still compact. Figure 4(e) cases, the modified EGENET solver spent around 3 9 and Figure 4(f) show some better layout adjustment by the times of the timings required for SCALE or FSA in the normodified EGENET solver in both static and dynamic conmal cases except with a sharp increase for the first relatively texts. Clearly, as for this example, FSA gives a more comcomplicated example. Nevertheless, the timings for findpact adjusted layout than SCALE since FSA employs more ing the best layouts by the modified EGENET solver are, in intelligent computation to move the affected nodes only to general, still within a reasonable period of time for all these the necessary distance when node overlapping is detected. cases. Clearly, we may need to conduct more experiments Both modified EGENET solvers give even more compact on this direction to verify the increase, possibly exponenlayouts than FSA by their stochastic local search to remove tial growth, in the timing of the modified EGENET solver node overlapping between the conflicting node-pairs. In adto find a solution in term of total number of nodes or the dition, these results demonstrate the flexibility of the modamount of node overlapping in the initial layout. ified EGENET approach to handle different semantic conLastly, Figure 5 shows the resulting layout by our modstraints and optimization criteria used for different contexts ified EGENET with no edge overlapping and edge labels in many real-life applications. inserted into a modified example of Graph 1 for the static case. For all our test cases, the edge labels are always taken We also provide an empirical evaluation of the results of to be halfway in between two connecting nodes for simplictime and cost for SCALE, FSA and the modified EGENET ity. These results demonstrated the feasibility of our simple solver on these arbitrary examples of graph layouts with 14; 6 and 10 nodes respectively for both static and dynamic proposal. Whenever the edge labels are overlapped during cases in Table 1. The time given in both tables is the CPU the search, we will penalize the connecting nodes so as to push them away from each other. Definitely, we should intime in seconds for finding the optimal solution for each vestigate more sophisticated techniques to remove these lasolver. The cost is the value returned by the ost function (e) Modified EGENET (stat.)

Acknowledgement

13 400 14

8

11

I would like to thank Peter Stuckey for his discussion and encouragement on this work.

300 7

6

4 10

200 3

2

References

12 5

100

1 9 200

300

400

500

600

Figure 5. Modified Graph 1 with no edge overlapping

bel overlapping in the future.

4 Conclusion In this paper, we consider an interesting proposal to modify the min-conflict heuristic-based EGENET solver originally designed for finite-domain constraint solving to solving graph layout problems as example CCOPs. We described a modified EGENET algorithm to solve continuous CSPs, which was later extended to the EGENET-opt algorithm for solving general CCOPs. In particular, we studied layout adjustment for both the static case, in which we wish to remove node overlapping while minimizing the total area and for the dynamic case, in which we wish to remove node overlapping while preserving the mental map. Since no standard benchmarks/test cases have yet been established for this area6 , we performed an empirical evaluation of our modified EGENET approach on a set of arbitrary graph layout problems. Our preliminary results have showed that the modified EGENET solver is reasonable fast and gives nice layout, which is better than that of the comparable algorithm, the FSA of Misue et al. However, to study the scalability of our approach to practical applications, we are now actively seeking the cooperation of a governmentbased research company to provide us some real graph data with hundreds or thousands of nodes. Also, that company has already shown strong interests in our proposed techniques to handle some of their graph display problems. Besides, there are several other interesting directions such as the uses of extra semantic constraints to produce better layouts for the graph layout problems, the applicability of our modified EGENET approach to the the other CCOPs, and the other possible modifications to the original EGENET model which prompt for further investigation. 6 In fact, we are planning to establish a library of standard test cases for graph layout adjustment by ourselves.

[1] E. Aarts and J. Korst. Boltzmann machines for traveling salesman problems. European Journal of Operational Research, 39:79–95, 1989. [2] H. Adorf and M. Johnston. A discrete stochastic neural network algorithm for constraint satisfaction problems. In Proceedings of the International Joint Conference on Neural Networks, 1990. [3] A. Davenport, E. Tsang, C. Wang, and K. Zhu. GENET: A connectionist architecture for solving constraint satisfaction problems by iterative improvement. In Proceedings of AAAI’94, 1994. [4] G. Dozier, J. Bowen, and D. Bahler. Solving small and large scale constraint satisfaction problems using a heuristicbased microgenetic algorithm. In Proceedings of the IEEE International Conference on Evolutionary Computation, 1994. [5] P. Eades, W. Lai, K. Misue, and K. Sugiyama. Preserving the mental map of a diagram. Technical Report IIAS-RR91-16E, International Institute for Advanced Study of Social Information Science, Fujitsu Laboratories Ltd., 1991. [6] D. Johnson, C. Aragon, L. McGeoch, and C. Schevon. Optimization by simulated annealing: an experimental evaluation; Part II, graph coloring and number partitioning. Operations Research, 39(3):378 – 406, 1991. [7] J. Lee, H. Leung, and H. Won. Extending GENET for NonBinary CSP’s. In Proceedings of Seventh International Conference on Tools with Artificial Intelligence, 1995. [8] D. Leunberger. Linear and Nonlinear Programming. Addison-Wesley Publishing Company, 1984. [9] S. Minton, M. Johnston, A. Philips, and P. Laird. Minimizing conflicts: a heuristic repair method for constraint satisfaction and scheduling problems. Artificial Intelligence, 58:161 – 205, 1992. [10] K. Misue, P. Eades, W. Lai, and K. Sugiyama. Layout adjustment and the mental map. Journal of Visual Languages and Computing, 6:183–210, 1995. [11] Y. Shang and B. W. Wah. A discrete lagrangian-based global-search method for solving satis fiability problems. Journal of Global Optimization, 1997. [12] E. Tsang. Foundations of Constraint Satisfaction. Academic Press, 1993. [13] C. Voudouris and E. Tsang. Partial constraint satisfaction problems and guided local search. Technical Report CSM250, Dept. of Computer Science, University of Essex, 1995. [14] C. Wang and E. Tsang. Solving satisfaction problems using neural-networks. In Proceedings of IEE Second International Conference on Artificial Neural Networks, 1991. [15] Z. Wu. The discrete lagrangian theory and its application to solve nonlinear discrete constrained optimization problems. Master’s thesis, Graduate College of the University of Illinois at Urbana-Champaign, 1998.

Suggest Documents