VF2 graph isomorphism takes very long or is stuck

Bug #1052213 reported by Gábor Csárdi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
In Progress
Medium
Gábor Csárdi

Bug Description

See the attached two graphs

library(igraph)
g1 <- read.graph("graph_first.txt", dir=FALSE)
g2 <- read.graph("graph_second.txt", dir=FALSE)
graph.isomorphic.vf2(g1, g2)

Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Here is the second graph

Tamás Nepusz (ntamas)
Changed in igraph:
status: Confirmed → In Progress
assignee: nobody → Tamás Nepusz (ntamas)
milestone: none → 0.6.1
Revision history for this message
Tamás Nepusz (ntamas) wrote :

Could be a particularly hard problem instance for VF2; it manages to match 48 vertices out of 70 and then keeps on backtracking. When the algorithm gets stuck, it is trying to match vertices of degree 4 with each other.

I guess that the VF2 algorithm makes an erroneous assignment very early and then it takes a long time until it manages to backtrack there.

Revision history for this message
Tamás Nepusz (ntamas) wrote :

Running since 48 hours and still counting. It would be interesting to check whether the original VF2 implementation behaves this way as well or not.

description: updated
description: updated
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Tamás, anything going on with this? I did some checks, too, and it seems that it just takes too long.

I could start a run, with a check that the algorithm is progressing (e.g. checking the mapping vector, and that every time we go down in the search tree, it advances), and let it run it for a couple of days......

Revision history for this message
Tamás Nepusz (ntamas) wrote :

No progress since then; I killed the process after a while and I'm pretty much convinced that the algorithm just takes too long (although I wonder why it takes so long when LAD can figure it out almost instantly). The only thing I worry about right now is whether it is possible for the algorithm to get stuck in an infinite loop where it traverses the same part of the search tree over and over again, and I'm afraid that putting in a counter won't help with that.

Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

It is not a counter. You have the matching vector, and you can imagine that this vector is a big number of base |V|+1, each element of the vector is one digit. If you matched 'm' vertices so far, then you only use the first 'm' digits from the vector, the rest is assumed to be zero. Then, as the algorithm progresses, that number must increase when you are stepping down in the search tree. When you are stepping up the tree, then the number temporarily decreases, but that is fine, because you cannot step up too many times before stepping down.

So if you always make sure that stepping down increases the matching vector, then, you avoid infinite loops.

If you know what I mean, sorry, this is quite dense.

Revision history for this message
Tamás Nepusz (ntamas) wrote :

Ah, I understand. (I thought that you intend to use a counter to count how many partial matches have been tried so far). Sounds reasonable so go ahead if you wish.

Changed in igraph:
assignee: Tamás Nepusz (ntamas) → Gábor Csárdi (gabor.csardi)
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

It is actually more difficult than I thought, because the vertices are matched by a heuristic order, and this makes it hard(er) to enumerate the partially matching configurations.

So I suggest we postpone this to 0.7.

Tamás Nepusz (ntamas)
Changed in igraph:
milestone: 0.6.1 → 0.7
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/238

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.