Hello group,

I'm looking at embeddings of complete gaphs and I think I've found a bug: I
defined the complete graph k12 as a (sort of) Cayley graph of the group
Z₂²× Z₃ as follows:

g12 = AbelianGroup(3, [2, 2, 3], names='ABC')
[A, B, C] = g12.gens()

k12 = Graph()
for x in g12:
for y in [A, B, A*B]:
if not (x*y, x) in k12.edges():
k12.add_edge((x, x*y))
for y in [C, A*C, B*C, A*B*C]:
k12.add_edge((x, x*y))

# The cyclic order around the vertices:
cy = [ C, A*C, C^-1, A*C^1, B*C, A*B*C, B*C^-1, A*B*C^-1, A, B, A*B ]

# The rotation dictionary
imb = {v : [ v*x for x in cy] for v in g12 }

k12.set_embedding(imb)
k12._check_embedding_validity()
# # ==>
# True
# # <==

So far so good. But then when I try to compute the genus (which should come
out as 22) and the faces I get an error:

k12.genus(on_embedding=imb)

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
----> 1 k12.genus(on_embedding=imb)

/Applications/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc
in genus(self, set_embedding, on_embedding, minimal, maximal, circular,
ordered)
4046 if on_embedding: #i.e., if on_embedding True (returns False if
on_embedding is of type dict)
4047 try:
-> 4048 faces = len(self.faces(self._embedding))
4049 except AttributeError:
4050 raise AttributeError('graph must have attribute _embedding set to
compute current (embedded) genus')

/Applications/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc
in faces(self, embedding)
4183 while (len(edgeset) > 0):
4184 neighbors = embedding[path[-1][-1]]
-> 4185 next_node =
neighbors[(neighbors.index(path[-1][-2])+1)%(len(neighbors))]
4186 tup = (path[-1][-1],next_node)
4187 if tup == path[0]:

ValueError: 1 is not in list


and then for faces:

k12.faces()

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
----> 1 k12.faces()

/Applications/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc
in faces(self, embedding)
4183 while (len(edgeset) > 0):
4184 neighbors = embedding[path[-1][-1]]
-> 4185 next_node =
neighbors[(neighbors.index(path[-1][-2])+1)%(len(neighbors))]
4186 tup = (path[-1][-1],next_node)
4187 if tup == path[0]:

ValueError: 1 is not in list

Is this a bug or am I doing something wrong?

Please, if it's not a touble, cc me in any answers. Thanks in advance.

Nikos

-- 
Οι ελαφροί ας με λέγουν ελαφρόν.
Στα σοβαρά πράγματα ήμουν πάντοτε
επιμελέστατος.

The frivolous can call me frivolous. In serious matters I've always been
most diligent.
  K. P. Kavafy

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to