Download presentation
Presentation is loading. Please wait.
1
Isomorphism Checking in GROOVE
Kaminski, Seidl et al. Muscholl Arend Rensink, University of Twente GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
2
Isomorphism Checking in GROOVE
Basics Universe of labels Lab Graphs: tuples G = <N,E,src,tgt,lab> Finite set of nodes N Finite set of edges E Source and target mappings src,tgt: E N Edge labelling lab: E Lab Isomorphism between G and H (G H): Mapping f: G H Bijective node and edge components fN, fE Structure-preserving: fNsrcG = srcHfE etc G and H are “essentially the same” GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
3
Isomorphism Checking in GROOVE
Examples 1 2 3 4 5 a b a b a b a b a b Which of these graphs are isomorphic? 1 3; all others are distinct Which of these graphs are bisimilar? (roughly: can mutually simulate one another) 1 3 5; all others are distinct Which have non-trivial symmetries? 1, 3, 4 and 5 GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
4
Isomorphism Checking in GROOVE
Complexity Traditional isomorphism question For given graphs G and H, is G H? In NP; unknown to be either in P or NP-hard Essential concept: graph certificate Existing algorithms use partition refinement Extended isomorphism question For given graph G and set of graphs S, find H S such that G H, if it exists More general: above case given by S = {H} Graph certificates also help in this problem GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
5
Isomorphism Checking in GROOVE
Graph certificates (1) Graph cerficate mapping Universe Cert of certificates; e.g., Nat Mapping c: Graph Cert Invariance: G H implies c(G) = c(H) Example: c: G |EG| Use 1: conservative approximation of iso c(G) c(H) implies (G H) Use 2: hash value in set of graphs S a b a b a b a b a b c=4 c=4 c=4 c=4 c=4 GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
6
Isomorphism Checking in GROOVE
Graph certificates (2) Refinement: element certificate mapping Mappings cN: Graph Node Cert cE: Graph Edge Cert Invariance: isomorphism f: G H implies cN(G) = cN(H) fN and cE(G) = cE(H) fE Example: cN(G): n |tgtG-1(n)|, cE(G): e hash(labG(e)) a b 1 2 1 2 a b 1 2 a b a b 1 2 a b 1 2 hash: a 1, b 2 GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
7
Isomorphism Checking in GROOVE
Graph Certificates (3) Use 1: Predict isomorphism f: G H implies fN cN-1(H) cN(G) fE cE-1(H) cE(G) Use 2: Define graph certificate mapping c1(G) = nN cV(G,n) + eE cE(G,e) c2(G) = <{cV(G,n)|n N},{cE(G,e)|e E}> 1 2 1 2 1 2 1 2 1 2 <{1},{1,2}> c1=12 <{0,1,2},{1,2}> c1=12 <{1},{1,2}> c1=12 <{0,2},{1,2}> c1=12 <{1},{1,2}> c1=12 GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
8
Inspiration: bisimilarity
Relation G over nodes + edges Largest symmetrical relation such that src(e1) n2 implies e1 e2 for some e2 with src(e2)=n2 and lab(e2)=lab(e1) vice versa for target nodes Weaker than isomorphism: f: G H an iso implies n GH fN(n) and e GH fE(e) a b a b Bisimilar graphs Equally coloured nodes Equally labelled edges GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
9
Bisimilarity co-inductively
Algorithm: G = i i given Sequence of relations with i+1 i 0 = (NGNG) { (e1,e2) EGEG | lab(e1)=lab(e2) } e1 i+1 e2 if src(e1) i src(e2) and tgt(e1) i tgt(e2) n1 i+1 n2 if i+1 is a total relation between src-1(n1) and src-1(n2) as well as between tgt-1(n1) and tgt-1(n2) Sequence converges for finite graphs Average complexity: |G| log |G| First iteration: All nodes, equally labelled edges Second iteration: Equally coloured nodes Equally labelled edges Third iteration: convergence a b a b GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
10
Isomorphism Checking in GROOVE
The algorithm (1) Iterated construction of certificates Inspired by bisimilarity characterisation Sequence of mappings (cNi,cEi)i Starting point: simple case like before Next steps: use end nodes/incident edges n i n2 implies cNi(n1)=cNi(n2), also for edges Not vice versa: certificates not precise Convergence: use partition size |N/i| Partition size may grow due to imprecision Stop when |N/i| |N/i-1| Derived graph certificate as hash key GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
11
Isomorphism Checking in GROOVE
The algorithm (2) Recall “extended isomorphism question” For given graph G and set of graphs S, find H S such that G H, if it exists If c(G) is fresh, no such H exists If c(H) = c(G), test for G H Test for equality (equal node and edge sets) If cNi is injective (|N/i|=|N|), G H iff { (n,cNi(n)) | nNG } yields an iso Otherwise, more complex extended iso test If G H, it is a false positive: add G to S GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
12
Definition of element certificates
Node mapping: cNi(n) = 1 if i = 0 cNi-1(v) + 2 n=src(e) ciE(e) + n=tgt(e) ciE(e) Edge mapping: cEi(e) = hash(lab(e)) if i = 0 newCert(cEi-1(e),lab(e),cNi(src(e)),cNi(tgt(e))) newCert determines “quality”: Should reduce imprecision/confusion Should be “maximally injective” Derived graph certificate c(G) = nN cVi(n) + eE cEi(e) GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
13
Isomorphism Checking in GROOVE
Example newCert(old,lab,src,tgt) := old + 2 src + tgt a b a b a b a b a b 1 2 1 2 1 2 1 2 1 2 17 18 5 6 17 19 18 21 5 6 4 7 17 18 5 6 19 20 7 4 17 18 5 6 190 193 57 59 190 193 57 59 232 233 85 43 190 193 57 59 |N/| = 2 |N/| = 2 c = 998 |N/| = 1 |N/| = 1 |N/| = 4 c = 97 |N/| = 2 c = 998 |N/| = 2 |N/| = 1 |N/| = 2 c = 1186 |N/| = 1 |N/| = 2 |N/| = 2 c = 998 |N/| = 2 |N/| = 1 GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
14
Implementation new edge certification function
int[] tmp = new int[vSize]; // temporary node certificates int partSize = 1, oldPartSize; // partition size // initialise the certificates for (int e = 0; e < eSize; e++) eCert[e] = hash(lab[e]); for (int v = 0; v < vSize; v++) vCert[v] = 1; do { // calculate the new edge certificates for (int e = 0; e < eSize; e++) { eCert[e] = newCert(eCert[e], lab[e], vCert[src[e]], vCert[tgt[e]]); // propagate to the endpoints tmp[src[e]] += eCert[e]; tmp[tgt[e]] += 2*eCert[e]; } // calculate new node certificates and determine partition size IntSet certSet = new IntSet(); oldPartSize = partSize; for (int v = 0; v < vSize; v++) { // copy the temporary node certificates to the real ones vCert[v] = tmp[v]; tmp[v] = 0; certSet.add(vCert[v]); partSize = certSet.size(); } while (partSize > oldPartSize); // continue while the number of cells still grows new edge certification function special set to count ints GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
15
Isomorphism Checking in GROOVE
Example (2) 1 2 3 4 5 190 193 57 59 17 19 18 21 5 6 4 7 190 193 57 59 232 233 85 43 190 193 57 59 c1 = 998 c2 = 97 c3 = 998 c4 = 1186 c5 = 998 S0 = empty: c1 = 998 not in c(S0), 1 is fresh S1 = {1}: c2=97 not in c(S1), 2 is fresh S2 = {1,2}: c3 = 998 = c1 in c(s2), |N/| |N|; 3 1 after extended iso test, 3 not fresh S3 = {1,2}: c4 = 1186 not in c(S3), 4 is fresh S4 = {1,2,4}: c5 = 998 = c1 in c(s4), |N/| |N|; (5 1) after extended iso test, 5 is fresh GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
16
Isomorphism Checking in GROOVE
Experiments Mutex algorithm [Heckel] Small states (graphs up to 6 nodes) “Unpredictable” symmetries Dining philosophers n-fold symmetry; here n = 12 No node creation/deletion Concurrent append Symmetry mainly due to confluence List length 8, 4 concurrent methods Gossiping girls Huge amount of symmetry; here for 8 girls GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
17
Isomorphism Checking in GROOVE
Results GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
18
Isomorphism Checking in GROOVE
Conclusion Experience: performance acceptable Large fraction of total exploration time Pays off for problems with many symmetries Certificates are very good predictor for iso Related work: McKay (Nauty) Based on the same principles Idea: in case of non-injective element certificates, break symmetry and observe effects Not straightforward to reuse Future work: avoid the iso check! Take confluence into account Optionally switch off isomorphism checking GRABATS 2006, Natal, Brazil Isomorphism Checking in GROOVE
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.