Removing duplicate graph states

Dear all,

I have many different states of the same graph. Every state corresponds to
a given set of values on the nodes fixed using 'new_vertex_property.' I
want to select unique network states, i.e., I want to remove the duplicate
states from the collection. Is there any way in graph-tool to achieve this?
If not, what is the solution?

Thank you

attachment.html (726 Bytes)

Your question is too vague. Without a specific code example, it is difficult
to help you.

Consider the following:

g =['karate']

g1 = gt.Graph(g)
g2 = gt.Graph(g)
g3 = gt.Graph(g)

state1 = g1.new_vertex_property('int')
state2 = g2.new_vertex_property('int')
state3 = g3.new_vertex_property('int')

for v in g1.vertices():
    state1[v] = 1

for v in state2.vertices():
    state2[v] = 1

for v in g3.vertices():
    state3[v] = -1

I want something like this: set([g1, g2, g3]) = {g1, g3} because states of
g1 and g2 are exactly same for all the vertices but are different from that
of g3.

Thank you

attachment.html (2.54 KB)

Just do:

   set([tuple(state1.a), tuple(state2.a), tuple(state3.a)])

(I'm assuming you want to construct a set of the property maps, not graphs.)

That works! Thanks a lot.

attachment.html (1.57 KB)