Skip to content

subgraph_isomorphism crashes when vertex indices don't start at zero

import graph_tool.all as gt

Bug = True

G = gt.complete_graph(10)
print "G: {}".format(", ".join(map(str,G.vertices())))

vfilt = G.new_vertex_property("bool")
for v in G.vertices(): vfilt[v] = True
if Bug: 
  for i in xrange(0,2):  vfilt[G.vertex(i,use_index=False)] = False
else: 
  for i in xrange(8,10): vfilt[G.vertex(i,use_index=False)] = False
G1 = gt.GraphView(G,vfilt=vfilt)
print "G1: {}".format(", ".join(map(str,G1.vertices())))

vmaps, emaps = gt.subgraph_isomorphism(G1,G,max_n=1)
Edited by Tiago Peixoto