ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 29 Dec 2012 02:44:09 -0600A faster way to obtain orbits of a partition of the verrtex sethttps://ask.sagemath.org/question/9660/a-faster-way-to-obtain-orbits-of-a-partition-of-the-verrtex-set/I am given a graph $G$ a set $S \subseteq V(G)$ and a vertex $v.$ I want to compute the representatives for the orbits of the stabilizer of $v$ of $\rm{Aut}(G)$ whose equivalence classes contain elements of $S.$ Currently what I am doing is the following:
<pre>
def compute_valid_orbit_reps(G,S,v):
ret = []
O = G.automorphism_group(return_group=False, orbits=True,
partition=[ [v], [el for el in G.vertices() if el != v]])
for el in O:
if S.intersection(set(el)):
nb = el[0]
G.add_edge(nb,v)
if G.girth() >= 5:
ret += [nb]
G.delete_edge(nb,v)
return ret
</pre>
I am wondering if there is a more efficient way to do the same, perhaps using GAP directly?
Best,
JernejSat, 29 Dec 2012 02:44:09 -0600https://ask.sagemath.org/question/9660/a-faster-way-to-obtain-orbits-of-a-partition-of-the-verrtex-set/