graph isomorphism and qap variances - semantic scholar · graph isomorphism and qap variances...

26
Graph isomorphism and QAP variances Valdir Agustinho de Melo * Paulo Oswaldo Boaventura-Netto * Peter Hahn ** Laura Bahiense * * Production Engineering Program, COPPE/Federal University of Rio de Janeiro, Brazil [email protected], [email protected], [email protected] ** Department of Electrical and Systems Engineering, University of Pennsylvania, Pennsylvania, USA, [email protected] RÉSUMÉ. Des variances des valeurs des solutions, calculables en temps polynomiale, peuvent être obtenues pour chaque instance du problème d’affectation quadratique (PAQ). Le problème de l’isomorphisme des graphes peut être modelé comme un PAQ par la construction d’une ins- tance avec ses deux matrices d’adjacence. Dans ce travail on cherche des fonctions de poids invariants pour les arêtes de ces graphes comme un outil pour montrer des differences entre les variances qui puissent être associées à l’absence d’isomorphisme. La technique est assez sen- sible pour déceler l’effet d’une seule 2-exchange d’arêtes entre deux graphes réguliers jusqu’a 2000 sommets et 500.000 arêtes et entre deux graphes planaires jusqu’a 3000 sommets dans l’ensemble d’exemples utilisés. ABSTRACT. Variances of solution values that can be calculated in polynomial time may be associated with an instance of the Quadratic Assignment Problem (QAP). The problem of graph isomorphism can be modeled as a QAP, associating each data matrix with each graph. In this work, we look for invariant edge weight functions for the graphs composing the instances in order to try to find quantitative differences between variances which would be associated with the absence of isomorphism. This technique is sensitive enough to show the effect of a single edge exchange between two regular graphs of up to 2000 vertices and 500,000 edges and between two planar graphs of up to 3000 vertices, within the samples utilized. MOTS-CLÉS : Isomorphisme de graphes, problème d’affectation quadratique, variances. KEYWORDS: Graph isomorphism, Quadratic assignment problem, variances. Studia Informatica Universalis.

Upload: others

Post on 13-Mar-2020

20 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Graph isomorphism and QAP variances

Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto *— Peter Hahn ** — Laura Bahiense*

* Production Engineering Program,COPPE/Federal University of Rio de Janeiro, Brazil

[email protected], [email protected], [email protected]** Department of Electrical and Systems Engineering, University of Pennsylvania,

Pennsylvania, USA, [email protected]

RÉSUMÉ. Des variances des valeurs des solutions, calculables en temps polynomiale, peuvent

être obtenues pour chaque instance du problème d’affectation quadratique (PAQ). Le problème

de l’isomorphisme des graphes peut être modelé comme un PAQ par la construction d’une ins-

tance avec ses deux matrices d’adjacence. Dans ce travail on cherche des fonctions de poids

invariants pour les arêtes de ces graphes comme un outil pour montrer des differences entre les

variances qui puissent être associées à l’absence d’isomorphisme. La technique est assez sen-

sible pour déceler l’effet d’une seule 2-exchange d’arêtes entre deux graphes réguliers jusqu’a

2000 sommets et 500.000 arêtes et entre deux graphes planaires jusqu’a 3000 sommets dans

l’ensemble d’exemples utilisés.

ABSTRACT. Variances of solution values that can be calculated in polynomial time may be

associated with an instance of the Quadratic Assignment Problem (QAP). The problem of graph

isomorphism can be modeled as a QAP, associating each data matrix with each graph. In

this work, we look for invariant edge weight functions for the graphs composing the instances

in order to try to find quantitative differences between variances which would be associated

with the absence of isomorphism. This technique is sensitive enough to show the effect of a

single edge exchange between two regular graphs of up to 2000 vertices and 500,000 edges and

between two planar graphs of up to 3000 vertices, within the samples utilized.

MOTS-CLÉS : Isomorphisme de graphes, problème d’affectation quadratique, variances.

KEYWORDS: Graph isomorphism, Quadratic assignment problem, variances.

Studia Informatica Universalis.

Page 2: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

210 Studia Informatica Universalis.

1. Introduction

The graph isomorphism problem (GIP) is generally dealt with intwo ways, stemming from its theoretical interest and from its pos-sible applications, such as pattern recognition, [DePK03], [BS98]. Foreach discussion presented in the present work, the fundamental graph-theoretical concepts can be found in Harary [Ha71] and Gross and Yel-len, [GY05].

Let us consider two simple graphs G1 = (V1, E1) and G2 = (V2, E2)with independent labelings of their vertex sets. We say that G1 and G2

are isomorphic if and only if there is a bijection ϕ : V1 ↔ V2 thatpreserves their adjacency relations. The more general problem ariseswhen G1 is a graph and and G2 is a subgraph of another graph with atleast the same order and size of G1. A particular case, which the presentwork addresses, is that of the isomorphism between two graphs of thesame order and size. GIP is peculiar in the sense that it is NP, but to dateno one has been able to say if it is polynomial or NP-complete, Gareyand Johnson [GJ79], Arvind and Thoran [AT85].

We say that a graph parameter is (an) invariant if it has the same va-lue for every isomorph of a given graph. The most readily available in-variants to consider are the order and the size, but it is evident that whatis of interest is to find an invariant whose value change from one graphto another graph not isomorphic to the first one, would be a necessaryand sufficient condition – which is not, exactly, the case of order andsize.An important invariant to consider is the ordered degree set (ODS)associated to a graph but, once more, two graphs with the same ODScan be non-isomorphic. On the other hand, two graphs with differentODS are non-isomorphic – and the ODS is easy to calculate through anefficient ordering algorithm.

A number of theoretical and computational resources have been ap-plied to the study of graph isomorphism. McKay [McK81] proposeda specific algorithm ; Burke and Shearer [BS98] is a theoretical paperdefining a distance between two graphs ; Cross et al [CWH97] uses ametaheuristic and DePiero and Krout [DePK03] uses path counts to ap-proximate subgraph isomorphism. Jain and Wyzotski [JW05] uses neu-ral nets ; Fischer and Matsliah [FM08] studied the complexity of a unit

Page 3: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 211

query and the minimum number of queries to find if two graphs areor not isomorphic ; Ding and Huang, [DH09] reorganize the graph insearching for a perimeter and a canonical adjacency matrix.

This work considers the particular isomorphism problem within thestructure of the Quadratic Assignment Problem (QAP). The databasefor a QAP instance is a pair of (symmetric) matrices F and D, whichare frequently associated with work flows between pairs of machinesand distances between machine locations. A QAP instance can be builtwith the adjacency matrices of two simple graphs of equal order andsize, and if we look for its maximum value solution we will find a valuez∗ = m if the graphs are isomorphic, or z∗ < m if they are not. Havingthe optimum z be equal to m is a necessary and sufficient condition forisomorphism, but we find immediately a complexity problem.

The QAP is NP-hard and experience shows its exact resolution is pre-sently limited, for the majority of cases, to instances with order below40. Specially designed heuristics, as well as metaheuristics, have beenapplied to it, Loiola et al [LABHQ07]. With these resources, graph pairsof up to 600 vertices have been successfully tested for isomorphism,[LRB07].

Despite the QAP’s NP-hardness, the calculation of the variance ofa QAP instance is polynomial, Boaventura-Netto and Abreu, [BA97],Abreu et al, [ABQG02]. Given a graph pair (G, H), we can build threeinstances and calculate three variances, considering (G, H), (G, G) and(H, H). We can conclude immediately that, if G and H are isomor-phic, these three variances are equal. This equality, nevertheless, is notsufficient for the graphs to be isomorphic : it is easy to find counter-examples, such as the pair (Petersen graph, pentagonal prism) in Figure1.1.

Page 4: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

212 Studia Informatica Universalis.

To overcome this difficulty, we propose the use of invariant edgeweight functions of the two graphs.

The results shown in this paper concern regular graphs of 20 to 2000vertices and planar graphs of up to 3000 vertices. Two invariant valua-tions are used, the first one being chosen due to its good results, bothwith regular and planar graphs, in the sense that it shows significantdifferences between pairs of graphs very close to isomorphism. The se-cond one is not suitable for regular graphs, but it is computationallyless complex than the first one and presented good discrimination witha number of planar graphs. The use of regular graphs has to do withthe increased difficulty to be foreseen in distinguishing between themand the study of planar graphs considers both the linearity of their sizewith respect to their order and an eventual future application to patternrecognition which is not, nevertheless, within the scope of the presentstudy.

2. Theoretical basis

2.1. Quadratic Assignment Problem (QAP)

The QAP is the problem of how to assign n actvities to n positionsin such a way as to minimize the transportation cost between activitypairs over the distances associated with position pairs,

Page 5: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 213

z = minϕ∈Πn

1≤i<j≤n

fijdϕ(i)ϕ(j) (1)

Matrix F = [fij] is the flow matrix (quantities transported betweeni and j) and matrix D = [dkl] is the distance matrix (dkl being thedistance between positions k and l). Here, we consider symmetry, so Fand D are symmetric matrices. We will refer to an instance, for a givenF and D, as QAP (F, D).

We see that (1) parcels are related to the set Πn of all n-elementpermutations, with every QAP solution then being associated with apermutation ϕ ∈ Πn, in this case, based on positions with respect toactivities.

Statistic moments of QAP instances have been used to compare com-putational difficulty with respect to heuristic algorithms. This questionhas been studied by Graves and Whinston, [GW70], Herroeleven andvan Gils, [HG85], Mautor and Roucairol, [MR94] and Abreu et al,[ABQG02].

2.2. Statistic moments of QAP instances

For the symmetric QAP, we can store every instance data with theaid of two vectors, F and D, with order N = n(n−1)

2 , where a positionk can be associated with a matrix position (i, j) by the expression

k = (i− 1)n− i(i + 1)

2+ j. (2)

We can then define an N -order matrix, Q = FD�. This matrixcontains every parcel composing every QAP solution ϕ (n-order per-mutation) : since (1) shows us both i and j (i < j) with values between1 and n, every QAP solution has N parcels, which correspond to a setof independent positions in Q. All n! instance solutions can be foundthere among the whole N ! such sets. A problem based on Q is thereforea relaxation of the original QAP, where not every set of Q independentpositions correspond to a QAP feasible solution. We will denote saidrelaxation as QAP (Q).

Page 6: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

214 Studia Informatica Universalis.

It is interesting to observe that this problem is easily solved : we or-der F and D in opposite orders (for example, F in non-increasing andD in non-decreasing order), obtaining in this case vectors F− and D+)and define Q� = F−(D+)�. The trace of this matrix is equal to the mi-nimum value of the relaxed instance (its maximum being the sum ofthe values from the transverse greater diagonal). These values are scalarproducts and, for a given instance of QAP, they constitute, respectively,a lower and an upper bound for every instance solution. As scalar pro-ducts, they can be represented as �F−, D+� and �F−, D−�.

The average cost of an instance QAP (F, D), [GW70], [BA97],[AZ98], [ABQG02], is

µ =S

N, (3)

where S is the sum of every Q element.

The variance of the relaxed instance, QAP (Q), is, [GW70],[ABQG02],

σ2Q =

1

N(

N�

i=1

f 2i )(

N�

i=1

d2j) +

1

N(N − 1)

�σ2(fi)

� �σ2(dj)

�− µ2 (4)

(i, j = 1, ..., n)

The variance of the instance QAP (F, D) is, [BA97], [ABQG02],

σ2F,D = (S0 + S1 + S2)/n! − µ2, (5)

whereS0 = 4(n− 4)!

∩0

fijfrs

∩0

dijdrs (6)

S1 = (n− 3)!�

∩1

fijfrs

∩1

dijdrs (7)

S2 = 2(n− 2)!�

1≤i<j≤n

f 2ij

1≤i<j≤n

d2ij (8)

Page 7: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 215

and| ∩0 | = Cn−2,2, | ∩1 | = 2(n− 2), | ∩2 | = 1. (9)

The computational complexity of the first variance is thus O(n2), andthat of the second is O(n4), in both cases when we consider F and Das being full matrices..

2.3. Instance classes related to isomorphism

We can take a given Q� and choose a QAP (F−, D+) that has Qas a coefficient matrix, and also a related instance class where everyinstance will have the same Q� (they will thus be associated with thesame relaxed instance) and the same upper and lower bounds based onQ�. We then define, [ABQG02],

Relclass(F−, D+) = {QAP (F, D) | (F−)(D+)� = Q�} (10)

A QAP instance can be represented by two complete graphs KF

and KD, respectively edge-valued by weight functions w(KF ) =F and w(KD) = D. We will then say that two complete graphsKn(V1, E1, F ), Kn(V2, E2, D) are w-isomorphic if there is a permuta-tion α ∈ Πn such that (i, j) ∈ E1 ⇔ (α(i), α(j)) ∈ E2 andF (i, j) = D(α(i), α(j)). We will then denote this isomorphism asw(KF ) ≈ w(KD). QAP (F1, D1) and QAP (F2, D2) will thus be iso-morphic (QAP (F1, D1) ≈ QAP (F2, D2)) if and only if w(KF1) ≈w(KF2) and w(KD1) ≈ w(KD2).

On the other hand, we say that G1 = (V1, E1) and G2 = (V2, E2) areisomorphic if and only if there exists a function f which preservesthe adjacency relations over a permutation α of one of their vertexsets with respect to the other, that is, for every (i, j) ∈ E1 we havef(α(i), α(j)) ∈ E2.

A particular case of what has been discussed above is the weightfunction given by the graph adjacency matrix for a graph G =(V, E), A = [aij], aij = 1 if (i, j) ∈ E and aij = 0 if (i, j) /∈ E. Aprimary necessary condition for the isomorphism between two graphs

Page 8: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

216 Studia Informatica Universalis.

is for them to have equal order n and size m. Let us thus consider twographs G1 and G2 : if they are isomorphic, a QAP instance built withtheir respective adjacency matrices A1 and A2, as discussed above, willhave a maximum value m for the solution corresponding to the permu-tation α associated with the isomorphism. For a pair of non-isomorphicgraphs, we will obtain some value m� < m.

Theorem 2.1 [ABQG02] : Two isomorphic instances QAP (F1, D1)and QAP (F2, D2) have the same set of feasible solutions.

This isomorphism implies that there is isomorphism between the cor-responding relaxed instances, since they have the same Q�. However, notevery pair of relaxed instances satisfying this condition is isomorphic.

Corollary 2.2 : Two isomorphic instances have the same variance.

Proof : Immediate from Theorem 2.1, since they share the same setof feasible solutions.

The variance of QAP solutions is then an invariant with respect toinstance isomorphism. In Section 1 we had a first look on the practicaluse of this property, but it asks for a more detailed discussion.

3. Methodology

3.1. Comparison standard and valuation

The interest of seeking to determine isomorphism between twographs through the maximum value of a QAP instance defined by theiradjacency matrices is evident, as has been stated. Nevertheless, this isnot practical in the general case, since we would be replacing the solu-tion of a problem whose complexity is under debate, [GJ79], [AT85],with that of a NP-hard one, such as the QAP. On the other hand, thecomparison between QAP variances is polynomial, as it requires onlythe polynomial calculations shown above.

A practical means for making this comparison is to build three ins-tances : the first, QAP (G1, G2), composed with the matrices of bothgraphs and the other two, QAP (G1, G1) and QAP (G2, G2), using twocopies of the same matrix for each graph, thus allowing us to build a

Page 9: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 217

comparison standard. We will call these last two instances associatedinstances. A close examination of the expressions (3) to (??) shows thata number of their terms can be reutilized in the determination of theseassociated variances.

As for relaxed instances, Corollary 2.2 is only a necessary condi-tion : to have the same variance is not sufficient for two instances to beisomorphic. A consequence of this, which can be seen through prac-tical applications of the discussed methodology, is that a number ofgraph pairs with similar structures show equal variances for the threeinstances presented above. An example is given by the pair (Petersengraph, pentagonal prism) already presented in Figure 1.1.

For our work with theoretical examples, we then applied invariantedge weight function techniques to both graphs, in order to allow fordifferent values associated with differences on graph structures. Part ofthis work used specifically generated regular graphs to which randomedge exchanges were applied in a such a way as to preserve regularity.The edge weight function was then given by the number of 2-edge pathsbetween edge-defining vertex pairs, which is the same as the number ofclosed 3- or respectively 4-walks involving these pairs. This is easilyobtained through the square or, respectively, the cube of the value ma-trix, as follows from the theorem :

Theorem 3.1 (Festinger, [Bo06] ) : If G = (V, E) is a graph, A =

[aij] is its adjacency matrix and Ak = [a(k)ij ] is A kth potency, then the

value of a(k)ij is equal to the number of k− walks i and j ∈ V .

We should note that these k-walks are not necessarily elementarypaths (i.e., they can repeat vertices) but this does not raise any difficultyfor our application.

The weight function obtained is invariant with respect to isomor-phism because it depends only on the graph structure, which is the samefor two isomorphic graphs. We have used k = 2 or 3 for the majorityof the examples (for the case shown in Figure 1, we used k = 4, inaccordance with Petersen’s graph girth). In what follows we will referto the Festinger weight functions as c3 or c4 according to the size ofthe closed walks considered. With planar graphs, we also used an edge

Page 10: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

218 Studia Informatica Universalis.

weight function based on the degree sum (ds) of the vertices definingeach edge.

In support of this technique/approach, we present the followingconjecture :

Conjecture 3.1 : For every graph pair (G1, G2) of the same or-der and size, there exists an invariant valuation such that, for G1 andG2 non-isomorphic, the instances QAP (G1, G2), QAP (G1, G1) andQAP (G2, G2) will have different variances.

An interesting point is that, if it were possible to prove this conjecturefor polynomial invariant weight functions, this would be equivalent toestablish GIP complexity as being polynomial.

3.2. Regular graphs

We used a regular graph generator based on the number of availablepairs for including new edges. The inclusion follows the current degreevalues, looking for the correct value m = nd

2 , where d is the degree. Arecursive process for verification of the degree sequence is applied tocall correction routines and to validate the generation.

A collection of regular graphs with order from 20 to 2000 was ge-nerated, with copies of these graphs being subjected to 1, 4, 8 and 16random edge 2-exchanges in order to maintain regularity. In this textwe will call almost-isomorphs the graphs thus obtained. The graph fileswere identified by R(order_degree) and also, for the copies with exchan-ged edges, by the characters a, d, h and p, added at the end (these are the1st, 4th, 8th and 16th characters in the alphabet). We used the Festingerweight function described above, applied to the original graph and to itsalmost-isomorphs. Some least-order graphs were compared with othersgenerated with other seeds (designated in the table as Rxx_yya nd b).

3.3. Planar graphs

We worked with three classes of planar graphs :

Page 11: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 219

– two-dimensional (p, q) grid graphs, with n = pq vertices and m =2n− (p + q) edges ;

– triangled (p, q) grid graphs with windows, obtained by adding aconstant direction diagonal to each square in the former structures, withn = pq vertices and m = 3n− 2(p+ q)+1− 8w edges (where w is thenumber of edge exchanges) ;

– a class of graphs we named broken bicycle wheels (BBW), whichare graphs with an interior cycle with p vertices, where from each vertexa constant number q of edges go to consecutive vertices of an exteriorcycle. We say that the wheel is broken because in a BBW the first vertexbefore such a vertex set does not receive any edge from the center. A(p, q)-BBW has p(q+2) vertices and 2p(d+1) edges. The constructionis based on labels beginning with the inner cycle and continuing in theouter one.

The random edge exchanges were done as follows :

– for (p, q) grid graphs, a randomly selected 4-degree ver-tex had the 6-hour edge replaced by an edge between non-adjacent peripheral vertices (thus keeping constant ODS) :

– for triangled (p, q) grid graphs, a randomly selected vertex definesa square where a diagonal exchange is made. This square will be thecenter of a window with no diagonals :

Page 12: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

220 Studia Informatica Universalis.

– for (p, q)-BBW graphs, the last edge going from aninner vertex to an outer vertex is replaced by an edgegoing to the void vertex before the next set of edges :

4. Results

4.1. Regular graphs

The results involve the original and relaxed instances, the latterbeing easier to calculate but, since Relclass(F−, D+) includes non-isomorphic graphs, an equality of these variances does not guaranteeisomorphism under Conjecture 3.1, in contrast to the original instancevariances. Nevertheless it is useful to begin by calculating these va-riances, since it can be done quickly and a difference among the threevariances will be sufficient to assure that the graphs are not isomorphic.

Page 13: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 221

To make the visualization easier, the following tables present thesymmetrized percentage relations between the variances of the associa-ted instances, σ2(PQA(G1, G1)) and σ2(PQA(G2, G2)), and the va-riance of the instance built with the graph pair, σ2(PQA(G1, G2)),

R% Graph 1 = 100× σ2(PQA(G1, G1)

σ2(PQA(G1, G2))− 1, and (11)

R% Graph 2 = 100× σ2(PQA(G2, G2)

σ2(PQA(G1, G2))− 1. (12)

Table 4.1 shows some results for regular graphs from 20 to 2000vertices and degrees up to 500.

Couple Exchanges Edges Rel. % vars. Rel. % vars.Rn_d_k/k1 Graph 1 Graph2

No % m Dens. % Rlx Orig Rlx OrigR20_7_3/3a 1 1,428 70 36,84 4,8847 5,1388 -4,6572 -4,8494R20_7_3/3b 2 2,857 36,84 8,2152 8,1088 -7,5916 -7,4894R30_8_5/5a 1 0,833 120 27,59 1,1498 0,7823 -1,1367 -0,7013R30_8_3/3b 2 1,667 27,59 10,0587 9,9064 -9,1394 -8,9995R40_10_1/1a 1 0,500 200 25,64 6,0430 5,8336 -5,6986 -5,4934R40_10_2/2a 1 0,500 25,64 1,4465 1,3740 -1,4258 -1,3511R50_25_1/1a 1 0,148 625 51,02 0,0716 0,0578 -0,0716 -0,0577R50_25_2/2a 1 0,148 51,02 0,0870 0,0602 -0,0870 -0,0599R60_15_1/1a 1 0,222 450 25,42 0,2870 0.3019 -0,2862 -0,3008R60_15_2/2a 1 0,222 25,42 2,3140 2,2868 -2,2617 -2,2353R100_15_1/1a 1 0,133 750 15,15 0,1692 0,1696 -0,1689 -0,1693R100_15_1/1d 4 0,532 15,15 1,2770 1,2670 -1,2609 -1,2503R100_15_1/1h 8 1,064 15,15 2,3276 2,3120 -2,2746 -2,2567R100_15_1/1p 16 2,128 15,15 3,1484 3,2422 -3,0523 -3,1099R100_15_2/2a 1 0,133 15,15 1,0442 1,0518 -1,0334 -1,0408R100_15_2/2d 4 0,532 15,15 2,2580 2,2803 -2,2081 -2,2286R100_15_2/2h 8 1,064 750 15,15 4,0297 4,0329 -3,8736 -3,8766R100_15_2/2p 16 2,128 15,15 1,7110 1,7122 -1,6822 -1,6853R200_75_1/1a 1 0,013 7500 37,69 0,2563 0,2578 -0,2557 -0,2571R200_75_1/1d 4 0,053 37,69 0,0714 0,0704 -0,0713 -0,0703R200_75_1/1h 8 0,106 37,69 0,0121 0,0111 -0,0121 -0,0111R200_75_1/1p 16 0,213 37,69 0,0079 0,0073 -0,0078 -0,0073R200_75_2/2a 1 0,013 37,69 0,0001 0,0003 -0,0001 -0,0003R300_50_1/1a 1 0,013 7500 16,72 0,0501 0,0508 -0,0501 -0,0507R300_50_1/1d 4 0,053 16,72 0,0037 0,0034 -0,0037 -0,0034R300_50_1/1h 8 0,106 16,72 0,1739 0,1736 -0,1736 -0,1733R300_50_1/1p 16 0,213 16,72 0,1795 0,1789 -0,1791 -0,1786R300_50_2/2a 1 0,013 16,72 0,0713 0,0714 -0,0712 -0,0714R300_50_2/2d 4 0,053 16,72 0,0991 0,0991 -0,0991 -0,0990R300_50_2/2h 8 0,106 16,72 0,2310 0,2298 -0,2305 -0,2292R300_50_2/2p 16 0,213 16,72 0,0992 0,0971 -0,0991 -0,0970

Table 4.1 : Results for QAP instances made of almost-isomorphic regular graphs(20≤ n≤ 300)

Page 14: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

222 Studia Informatica Universalis.

Couple Exchanges Edges Rel. % vars. Rel. % vars.Rn_d_k/k1 Graph 1 Graph2

No % m Dens. % Rlx Orig Rlx OrigR400_50_1/1a 1 0,010 10000 12,53 0,0258 0,0256 -0,0208 -0,0256R400_50_1/1d 4 0,040 12,53 0,0021 0,0021 -0,0021 -0,0021R400_50_1/1h 8 0,080 12,53 0,1685 0,1683 -0,1682 -0,1680R400_50_1/1p 16 0,160 12,53 0,2598 0,2598 -0,2591 -0,2591R400_150_2_2a 1 0,003 30000 37,59 0,0033 0,0033 -0,0033 -0,0033R400_150_2_2d 4 0,013 37,59 0,0007 0,0007 -0,0007 -0,0007R400_150_2_2h 8 0,026 37,59 0,0068 0,0068 -0,0068 -0,0068R400_150_2_2p 16 0,052 37,59 0,0128 0,0127 -0,0128 -0,0127R500_50_1/1a 1 0,008 12500 10,02 0,1140 0,1135 -0,1138 -0,1133R500_50_1/1d 4 0,032 10,02 0,0896 0,0887 -0,0895 -0,0886R500_50_1/1h 8 0,064 10,02 0,0073 0,0071 -0,0073 -0,0071R500_50_1/1p 16 0,128 10,02 0,0403 0,0408 -0,0403 -0,0408R750_150_1/1a 1 0.0018 56250 20.02 0.00085 0.00086 -0.00085 -0.00086R750_150_1/1d 4 0.0071 20.02 0.00061 0.00062 -0.00061 -0.00062R750_150_1/1h 8 0.0142 20.02 -0.00068 -0.00062 0.00068 0.00062R750_150_1/1p 16 0.0284 20.02 0.02108 0.02096 -0.02107 -0.02095R750_300_1/1a 1 0.0009 112500 40.05 -0.000002 -0.000003 0.000002 0.000003R750_300_1/1d 4 0.0035 40.05 0.00126 0.00125 -0.00126 -0.00126R750_300_1/1h 8 0.0071 40.05 0.00149 0.00147 -0.00149 -0.00149R750_300_1/1p 16 0.0142 40.05 0.00190 0.00190 -0.00190 -0.00189R1000_250_1/1a 1 0.0008 125000 25.02 0.00040 0.00039 -0.00040 -0.00039R1000_250_1/1d 4 0.0032 25.02 -0.00089 -0.00089 0.00089 0.00089R1000_250_1/1h 8 0.0064 25.02 -0.00084 -0.00083 0.00084 0.00083R1000_250_1/1p 16 0.0128 25.02 0.00631 0.00632 -0.00631 -0.00632R1500_250_1/1a 1 0.0005 187500 16.68 0.00045 0.00045 -0.00045 -0.00045R1500_250_1/1d 4 0.0021 16.68 0.00210 0.00210 -0.00210 -0.00210R1500_250_1/1h 8 0.0043 16.68 -0.00231 -0.00231 0.00231 0.00231R1500_250_1/1p 16 0.0085 16.68 0.00921 0.00922 -0.00921 -0.00922R2000_250_1/1a 1 0.0004 250000 12.51 -0.00012 -0.00012 0.00012 0.00012R2000_250_1/1d 4 0.0016 12.51 -0.00220 -0.00220 0.00221 0.00220R2000_250_1/1h 8 0.0032 12.51 -0.00220 -0.00220 0.00220 0.00220R2000_250_1/1p 16 0.0064 12.51 -0.00157 -0.00157 0.00157 0.00157R2000_500_1/1a 1 0.0002 500000 25.01 -0.00008 -0.00008 0.00008 0.00008R2000_500/1/1d 4 0.0008 25.01 -0.00010 -0.00010 0.00010 0.00010R2000_500/1/1h 8 0.0016 25.01 0.00084 0.00084 0.00084 -0.00084R2000_500/1/1p 16 0.0032 25.01 0.00062 0.00062 -0.00062 -0.00062Table 4.1 (cont) : Results for QAP instances made of almost-isomorphic regular graphs

(400 ≤ n ≤ 2000)

We can observe that, for R750_300_1/1a, the present weight functionis close to the end of its discrimination possibilities, since the percentvariance relations become too small. The use of an overvaluation (e.g.,the sum value of adjacent edges for a given edge) would, in principle,avoid this difficulty – even when, within these examples, we could reach2000 vertices without further problems.

An interesting question deals with the effect of multiple edge ex-changes. Since they are done randomly, it is impossible to predicttheir effect on the invariant. For R400_150_2_2, we can see that the4-exchange (d) line shows lesser values than the 1-exchange (a) one.In contrast, the instances R100_15_1 showed increases in the relationswith the number of exchanges, as one would normally expect. Eventhough such a question would be of interest, it does not pertain to theobjectives of the present work, which is devoted to dealing with va-riance changes when a graph undergoes a relatively small number of

Page 15: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 223

edge exchanges in order to show the sensitivity of the technique withrespect to non-isomorphism.

The variance processing times are based on the use of a computerwith an Intel Core 2 Quad Q6600 processor, 2.4 Ghz HD and 3 Gb ofRAM, operating with Windows XP and a Fortran Powerstation IV com-piler. Figure 4.1, below, shows these times for the instances presentedin Table 4.1. Some of the points do not correspond to test results shownin Table 4.1, which has been shortened to avoid excessive use of space.

4.2. Planar graphs

For all planar graphs we studied, the edge exchange patterns wereshown in Item 3.3.

We took nine dimension couples (p, q) to define grid graphs from 30up to 3000 vertices, as shown in Table 4.2 below, with one and four edgeexchanges for each graph, using both the c4 and the degree-sum weightfunctions.

The triangulated grids with windows were built from 80 to 3000 ver-tices : the 30-vertex ones would offer little options for positioning 4windows.

Page 16: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

224 Studia Informatica Universalis.

The broken bicycle wheels were generated between (4,3) with 20verices and (50,20) with 1100 vertices.

A point to be taken into account is that no computing time data aregiven for planar graphs : for all but the greater instances (n < 1000) theexecution times obtained were below 0.05 seconds and no executiontime for the variances program was greater than 1 second, owing to thelow density of planar graphs.

The corresponding set of tests with triangled (p, q) grid graphs withwindows is shown in Table 4.3 below, using the shorthand Grdgw forGRid DiaGonal graphs with Windows. Here the c4 weight function wasapplied and we also show the results for the degree-sum one.

Page 17: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 225

Page 18: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

226 Studia Informatica Universalis.

Page 19: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 227

These graphs presented a serious challenge to the technique, as thecreation of the windows around the edge changes dilutes their effectson the graph structure, the changes in structure having the tendency ofbeing symmetric. As we can see, in the majority of the examples therelaxed variance relations are unable to discriminate among the triple ofinstances and the original variance relations present very small values.

As in Table 4.2, we show a column (see d%) of the planar densitym

3n−6 in percentage.

The (p, q)-BBW graphs do not answer to the degree-sum weightfunction, either with the relaxed or the original instances. The c4 weightfunction, on the contrary, allows for a good discrimination between theiralmost-isomorphs.

Page 20: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

228 Studia Informatica Universalis.p,

qn

Bbw

/Bbw

(exc

hang

es)

Exch

ange

sEd

ges

Rel

.%va

rs.G

raph

1R

el.%

vars

.Gra

ph2

No

%m

d%

Rlx

Ori

gR

lxO

rig

4,3

20Bb

w_4

_3/(1

,3)

26.

250

3259

.2-2

3.03

799

-23.

0199

429

.911

8529

.888

58Bb

w_4

_3/(2

,4)

-22.

5567

4-2

2.57

333

29.1

0547

29.1

3911

6,4

36Bb

w_6

_4/(1

,2)

23.

333

6058

.8-2

.044

02-2

.085

002.

0866

82.

1311

1Bb

w_6

_4/(1

,3)

-4.0

0473

-4.0

8168

4.17

180

4.26

239

8,6

64Bb

w_8

_6/(1

,5)

21.

786

112

60.2

-2.1

8505

-2.1

6645

2.23

385

2.21

449

Bbw

_8_6

/(1,3

,5,7

)4

3.57

2-4

.275

26-4

.236

134.

4662

04.

4238

110

,810

0Bb

w_1

0_8/

(1,5

,9)

31.

667

180

61.2

-1.4

4869

-1.5

0455

1.46

998

1.52

783

Bbw

_10_

8/(2

,4,6

,8)

42.

222

-1.9

2224

-1.9

9575

1.95

991

2.03

692

15,1

018

0Bb

w_1

5_10

/(3,5

)2

0.60

633

061

,8-0

.475

27-0

.490

170.

4775

40.

4926

0Bb

w_1

5_10

/(4,6

,8,1

0)4

1.21

2-0

.946

03-0

.975

450.

9550

60.

9851

320

,12

280

Bbw

_20_

12/(5

,10)

20.

384

520

62.2

-0.2

7432

-0.2

8161

0.27

507

0.28

241

Bbw

_20_

12/(6

,12,

18)

30.

577

-0.4

1091

-0.4

2181

0.41

261

0.42

361

30,1

551

0Bb

w_3

0_15

/(5,1

5)2

0.20

896

063

.8-0

.131

09-0

.133

710.

1312

60.

1338

9Bb

w_3

0_15

/(7,1

4,21

)3

0.31

2-0

.196

51-0

.200

430.

1969

00.

2008

350

,20

1100

Bbw

_50_

20/(1

0,20

,30)

30.

142

2100

63.7

-0.0

7523

-0.0

7623

0.07

529

0.07

629

Bbw

_50_

20/(1

5,25

,35,

45)

40.

190

-0.1

0028

-0.1

0162

0.10

038

0.10

172

Tabl

e4.

4:R

esul

tsof

QA

Pin

stan

cesm

ade

ofal

mos

t-iso

mor

phic

(p,q

)-BBW

with

wei

ghtf

unct

ion

c4

4.3. The effect of edge exchanges in planar graphs

Grid and triangulated grid graphs give us an easy view for the reasonsbehind the sensitivity of the QAP-supported technique. Figures 4.2 (a)and (b) show the effect of a single edge exchange on other edge values

Page 21: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 229

within the neighborhood of the concerned vertices, when we considerthe degree-sum weight function.

We can observe the degree-sum changes on the edges adjacent to theexchanged one. With the grid graphs shown in Figure 4.2 we have then12 value changings and, with grid-triangulated graphs with windows, 8changings. The effect on the QAP instance solution values can then bebetter visualized.

The BBW graphs suffer 2 degree-sum changes in the inner and in theouter cycles, the q adjacent edges between the two cycles changing alsotheir values. We have then q + 4 degree-sum changes. Differently fromthe previously examined families, the number of value changes growwith a graph parameter.

Page 22: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

230 Studia Informatica Universalis.

4.4. Processing time of weight functions

Both proposed weight functions are polynomial, ds(i, j) being O(m)and ck(i, j) being O(nk) if the matrix products are made with the entirematrices. Then the first one is cheeaper to calculate than the variances,and the second one is more expensive. By perfectioning the program-ming we can hope to lower the processing time of ck(i, j), speciallywith planar graphs owing to their lower density.

Table 4.5 presents some time processing results in seconds for theweight functions utilized in the tests.

Order,n Degree sum c3 walk counting c4 walk counting80 < 0.01 0.01 0.03

120 < 0.01 0.02 0.03300 0.01 0.7 0.97600 0.01 1.8 3.5

1000 0.01 10 171500 0.02 39 772000 0.02 95 2103000 0.02 210 400

Table 4.5 : Some processing times (sec) for the weight functions

It is easy to see that ds(i, j) times fall into the error margin of themachine time function, while c3(i, j) and c4(i, j) grow quite rapidly,their execution times being generally greater than those required by thecalculation of the variances. This situation puts a challenge in whatconcerns both the programming and the definition of new invariantweight functions.

4.5. An example of isomorphism

As a case of isomorphism we present Graph R30_8_1 withc3 weight function, together with a similarly valued isomorphcharacterized by a given permutation, as in Fig. 4.3 below.

Page 23: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 231

The graphs are given by their non-symmetric adjacency lists.

Page 24: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

232 Studia Informatica Universalis.

5. Conclusions

Within the order and degree we have used, the results obtained are inaccordance with Conjecture 3.1.

We used regular graphs because they seem to present a more dif-ficult problem than general graphs, according to structure restrictions.Nevertheless, general graphs could also be examined, as the techniquepresents no restriction concerning degree sequences.

For planar graphs, the linear relation between sizes of maximal pla-nar graphs and their order allows for a much greater efficiency in termsof computing time, which could open the technique to applications inthe field of pattern recognition problems. On the other hand, some diffi-culties have been observed, concerning the applicability of the functionsand the low values of some variance ratios.

A quick look at the influence of an edge exchange on the values ofthe neighbor edges in grid and triangulated grid graphs allows us to vi-sualize more easily the reasons behind the sensitivity of the technique.A similar analysis could be done for the weight functions based on Fes-tinger theorem.

The study shown here can be extended through the use of newweight function criteria and more efficient programming, specially forthe walk-counting techniques.

Références

[ABQG02] Abreu, N.M.M., Boaventura-Netto, P.O., Querido, T.M.and Gouvêa, E.F.. (2002). Classes of quadratic assignmentproblem instances : isomorphism and difficulty measuresusing a statistical approach. Discrete Applied Mathematics124, 103-116.

[AT85] Arvind, V. and Thorán, J. (1985). Isomorphism tes-ting : perspective and open problems. The Computatio-nal Complexity Column. Bulletin of the European Asso-ciation for Theoretical Computer Science. 86, 66–84. In.http ://theorie.informatik.uni-ulm.de/Personen/jt.html

Page 25: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

Combinatorial Optimization in Practice 233

[AZ98] Angel, R. and Zissimopoulos, V. (1998). On the quality ofthe local search for the quadratic assignment problem. Dis-crete Applied Mathematics 82, 15-25.

[BA97] Boaventura-Netto, P.O. and Abreu, N.M.M. (1997). Costsolution average and variance for the quadratic assign-ment problem : a polynomial expression for the varianceof solutions. Actas de Resumenes Extendidos, 408-413, IELIO/Optima 97, Concepción, Chile.

[Bo06] Boaventura-Netto, P.O., Grafos : Teoria, Modelos, Algorit-mos (in Portuguese). Edgard Blücher, São Paulo, 2006.

[BrMcK] Brinkmann, G. and McKay, B.D., Fast gene-ration of planar graphs. Accessed 11/24/2009,http ://cs.anu.edu.au/˜bdm/plantri/ .

[BS98] Bunke, H. e Shearer, K. (1998). A graph distance metric ba-sed on the maximal common subgraph. Pattern RecognitionLetters 19, 3-4, 255-259.

[CWH97] Cross, A. D. J., Wilson, R. C. and Hancock, E. R. (1997), In-exact graph matching using genetic search, Pattern Recog-nition, 30, n. 6, 953–970.

[DePK03] DePiero, F. and Krout, D. (2003). An algorithm usinglength-r paths to approximate subgraph isomorphism. Pat-tern Recognition Letters 24, 33-46.

[DH09] Ding, H. and Huang, Z. (2009). Isomorphism identificationof graphs : especially for the graphs of kinematic chains,Mechanism and Machine Theory 44, 122–139.

[FM08] Fischer, E. and Matsliah, A. (2008). Testing graph isomor-phism. SIAM J. of Computing 38, 1, 207-225.

[GJ79] Garey, M.R. and Johnson, D.S. (1979). Computers and in-tractability : a guide to NP-completedness. W.H. Freeman,1979.

[GW70] Graves, G.W. and Whinston, A.B. (1970). An algorithm forthe quadratic assignment problem. Management Science 17,453-471.

[GY05] Gross, J.L. and Yellen, J., eds. (2005). Handbook of graphtheory, CRC Press LLC, Boca Raton.

Page 26: Graph isomorphism and QAP variances - Semantic Scholar · Graph isomorphism and QAP variances Valdir Agustinho de Melo * — Paulo Oswaldo Boaventura-Netto * — Peter Hahn **—

234 Studia Informatica Universalis.

[Ha71] Harary, F. (1971). Graph theory, Addison-Wesley, Reading,Massachussetts.

[HG85] Herroeleven, W. and Van Gils, A. (1985). On the use of flowdominance in complexity measures for facility layout pro-blems. International Jornal of Production Research 23, 97-108.

[JW05] Jain, B.J. and Wysotski, F. (2005). Solving inexact graphisomorphism problems using neural networks, Neurocom-puting 63, 45–67.

[LABHQ07] Loiola, E.M., Abreu, N.M.M., Boaventura-Netto, P.O.,Hahn, P. and Querido, T.M. (2007). A survey for the qua-dratic assignment problem, European J. of Operational Re-search 176, 657-690.

[LRB07] Lee, L., Rangel, M.C. and Boeres, M.C.S.. (2007). Reformu-lação do Problema de Isomorfismo de Grafos como o Pro-blema Quadrático de Alocação (in Portuguese), Anais doXXXIX SBPO, 1601-1612, Fortaleza, setembro.

[McK81] McKay, B. (1981). Practical graph isomorphism. Congres-sus Numerantium 30 (1) 45-87.

[MR94] Mautor, T. and Roucairol, C. (1994). Difficulties of exactmethods for solving the quadratic assignment problem. InQuadratic Assignment and Related Problems, DIMACS Se-ries on Discrete Mathematics and Theoretical ComputerScience, Vol. 16, AMS, Providence, RI.