A polynomial graph extension procedure for improving graph isomorphism algorithms
We present in this short note a polynomial graph extension procedure that can be used to improve any graph isomorphism algorithm. This construction propagates new constraints from the isomorphism constraints of the input graphs (denoted by $G(V,E)$ a…
Authors: Daniel Cosmin Porumbel
A p olynomial g raph extension pro cedure for impro ving graph isomorphism algorithms Daniel Cosmin P orumb el No vem b er 4, 2021 Abstract W e present i n this short note a polynomial graph extension pro cedure that can b e used to impro v e an y graph isomorphism algorithm. Th is construction propagates new constraints from the isomorphism constrain ts of the input grap h s (denoted b y G ( V , E ) and G ′ ( V ′ , E ′ )). Th us, information from the edge structur e s of G and G ′ is ”hashed” in to the weig hted edges of the extended graphs. A b i jectiv e mapp ing is an isomorphism of the initial graphs if and only if it is an isomorphism of the extended graphs. As suc h, the construction enables the iden tification of pair of v ertices i ∈ V and i ′ ∈ V ′ that can not b e mapp ed by any isomorphism h ∗ : V → V ′ (e.g. if the extended edges of i and i ′ are differen t). A forbidding matrix F , that enco des all pairs of incompatible mapp ings ( i, i ′ ), is constructed in order to b e used b y a differen t algorithm. Moreo v er, tests on numerous graph classes sh o w that the matrix F migh t lea v e only one compatible elemen t for eac h i ∈ V . 1 In tro ductio n and Notations In theoretical computer scienc e, GI is one of the only N P problems that is not kno wn to b e either in P or N P − P (w e assume P 6 = N P ) a nd a lot of effort has b een done to classify it. Pro ofs of p olynomial time algorithms ar e a v ailable for man y graph classes [1, 3, 4], but, how ev er, all existing a lgorithms are still exp onen tial for some w ell-kno wn families of difficult graphs, e.g. regular graph isomorphism is GI-complete [2, 5] (if regular gra phs can b e t ested for isomorphism in p olynomial time, t hen so can b e an y tw o graphs). W e denote the adjacency matrices of G and G ′ b y M and M’. The n um b er of v ertices (denoted by | G | o r | V | ) is commonly referred to as the graph order. A mapping b et w een G and G ′ is represen ted by a bijectiv e function on the v ertex set h : V → V ′ . W e say that h ∗ is an isomorphism if and only if ( i, j ) ∈ E ⇔ ( h ∗ ( i ) , h ∗ ( j )) ∈ E ′ and the gr aph isomorphism (GI) pr oblem is to decide whether or not suc h an isomorphism exists. A critical problem of all tested algo rithms app ears in the fo llo wing situation: if there is no edge b et w een v ertex i and j in G (i.e. M i,j = 0) and no edge b et w een h ( i ) and h ( j ) in G ′ , than the assignmen t ( i, j ) h → ( h ( i ) , h ( j )) is not seen as a conflict—there is no mec hanism to directly detect whether ( i, j ) and ( h ( i ) , h ( j )) are indeed compatible o r not. But, b y exploiting the structure of the graph, one can find many conditions in whic h ( i, j ) and ( h ( i ) , h ( j )) are incompatible ev en if they are b oth disconnected (e.g. by chec k ing the shortest path b et w een them). 1 2 P olynomial gr aph exte nsion W e define the | V | × | V | matrix N α , in whic h the eleme nt N α i,j is the num ber of paths of length α (i.e. with α edges) from i to j . Obvious ly N 1 = M , and we now sho w that N α +1 can b e computed in p olynomial time from M and N α using the following algorit hm: Algorithm 1 G raph extension in p olynomial time Input : M and N α Result : N α +1 1. Set all elements of N α +1 to 0 2. For i = 1 to | V | For j = i + 1 to | V | If M [ i, j ] = 1 then For k = 1 to | V | • N α +1 [ i, k ] = N α +1 [ i, k ] + N α [ j, k ] • N α +1 [ j, k ] = N α +1 [ j, k ] + N α [ i, k ] • N α +1 [ k , j ] = N α +1 [ j, k ] and N α +1 [ k , i ] = N α +1 [ i, k ] The extended graph is stra ig h tforw ardly defined as t he w eigh ted graph with v ertex set V and w eigh ted edges E α suc h that if N α ij 6 = 0, then { i, j, N α ij } ∈ E . Two graphs G and G ′ are isomorphic if and only if their exte nded graphs are isomorphic—because the same extending op e rations are applied in the same manner for any t w o isomorphic v ertices i and h ∗ ( i ). An imp ortant adv an tage of constructing all matrices N 1 , N 2 , . . . N α is the early de- tection of incompatible (forbidden) assignmen ts, i.e. v ertices ( i ∈ V , i ′ ∈ V ′ ) that can nev er b e mapp e d by an isomorphism. Definition 1 (Comp atible assign ment) V ertic es i ∈ V and i ′ ∈ V ′ ar e compatible if and only if: (i) N α i,i = N ′ α i ′ ,i ′ and (ii) al l the values fr om line i of N α c an b e found in li ne i ′ of N ′ α and v ic e versa. Indeed, if h ∗ is a n isomorphism, then all a s signmen t ( i → h ∗ ( i )) are compatible; eac h elemen t ( i, j ) of line i of N α , can a ls o b e found at p osition ( h ∗ ( i ) , h ∗ ( j )) in line h ∗ ( j ) of N ′ α . Therefore, an y G I alg o rithm should neve r map tw o incompatible (forbidden) v ertices. W e intro d uce a matrix F enco ding forbidden mappings, i.e. if F i,i ′ = 1, i is nev er mapp ed to i ′ . This matrix is empt y at start (all elemen ts are 0), and the extension algorithm gradually fills its elemen ts while constructing the matrices N 1 , N 2 , . . . N α . The matrices N 1 , N 2 , N 3 , . . . a re v ery ric h in inf o rmation that is implicitly c hec k ed via the matrix F . Each edge v alue from the extended graph is in fa c t a a hash function of some larger structures in the initial graph. Indeed, the fact that an assignmen t i → i ′ is not forbidden (i.e. F ii ′ = 0) implies n umerous hidden conditions: i and i ′ need to ha v e the same degree (o t he rwise N 2 i,i 6 = N ′ 2 i ′ ,i ′ ), they need to b e part in t he same n um b er o f triangles (otherwise, N 3 i,i ! = N ′ 3 i ′ ,i ′ ), they need to hav e the same n um b e r of 2-step neighbors, etc. Man y other such theoretical conditions can be deriv ed and prov ed, but the g o al of this 2 sp ec ific pap er is only to presen t a v ery practical, high-speed algo r it h m; suc h theoretical conditions are in v estigated in greater detail in a completely differen t t h eoretical study . Finally , w e note that our pra c tical C++ implemen tation uses unsigned long in teger v ariables enco ded on 64 bits. Ho w ev er, for large v alues of α , N α i,j can exceed 2 32 − 1; therefore, w e consider all a dditio n op erations Modulo 2 32 (in our C++ v ersion, the v ariables are enco de d so that 2 32 − 1 + 1 = 0). This observ ation do e s not c ha ng e the fact that f α ( h ∗ ) = 0 when h ∗ is an isomorphism, b ecause if N α i,j = N ′ α h ( i ) ,h ( j ) , then N α i,j = N ′ α h ( i ) ,h ( j ) ( M odulo 2 32 ). Ho w ev er, it is still theoretically p ossible to ha v e t he Mo dulo equalit y without the non-Mo dulo equalit y . 3 Conclus ion W e implemen ted sev eral algorithms, b oth exact a nd heuristics using this prop ert y (esp e- cially the matrix F ). Generally sp eaking, suc h an algo r it hm consists in tw o stages: (i) the graph extension (ii)the effectiv e algorithm that can b e quite naiv e. The first stage builds the information-rich adjacency matrix N α and it also pro vides a matrix F of f o rbidde n v ertex assignmen ts. Numerous t ests of suc h a n algorithm with v ery large graphs show w orst-case b eha vior of p olynomial time. Only the strongly regular gr a ph s can sho w more difficulties, but w e tested o nly sev eral strongly regular graphs with up to 275 v ertices and t he b eha vior seems similar. L a rger strongly regular graphs are not classified, a n d since there is no practical algorithm to generate t hem, w e restricted to examples publicly a v a ila ble on the In ternet—the McLaughlin Gra ph with 275 ve rtices. The extending pro cedure prov ides additio nal evidence that the graph isomorphism can b e (at least in practice) solv ed in p olynomial time for almost all gr a ph t yp es w e kno w. References [1] L. Babai, D.Y. Grigor yev , and D. M. Moun t. Isomorphism of graphs with b ounded eigen v alue m ultiplicity . In F o u rte en t h A nnual A CM Symp osium on T he ory of Com- puting , pages 310–7324, 1982. [2] K.S. Bo oth. Is omorphism testing for graphs, semigroups, and finite automata are p olynomially equiv alent problems. SI AM Journal of C omputing , 7(3):27 3–279, 1978. [3] I. S. Filotti and J. N. Ma y er. A p olynomial-time algorithm for determining t he isomorphism of graphs of fixed genus . In STOC ’80: Pr o c e e din gs of the twelfth annual A CM symp osium on The ory of c omputing , pages 236–243. A CM, 1980. [4] E. M. Luks. Isomorphism of g raphs of b ounded v alence can be tested in p olynomial time. Journal of c omputer and system scienc e s , 2 5(1), 1982 . [5] V. N. Z e mly ache nk o, N. M. Korneenk o, a nd R. I. T yshk evic h. Graph isomorphism problem. Journal of Mathematic al Scienc es , 29(4):1426 –1481, 1985. 3
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment