#10276: Create a random triangulation (max planar graph)
-------------------------------------+-------------------------------------
       Reporter:                     |        Owner:  jason, ncohen, rlm
  edward.scheinerman                 |       Status:  needs_review
           Type:  enhancement        |    Milestone:
       Priority:  major              |   Resolution:
      Component:  graph theory       |    Merged in:
       Keywords:  random graph       |    Reviewers:
        Authors:  Ed Scheinerman     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  u/chapoton/10276   |  0158086673e62ca06d6529ec2d4f25210395ab65
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by dcoudert):

 * cc: dcoudert (added)


Comment:

 Hello,

 I have a random error with your code, not directly caused by your code.
 From time to time, the following happens:

 {{{
 sage: g = graphs.RandomTriangulation(70, embed=True)
 sage: g
 Planar triangulation on 70 vertices
 sage: g = graphs.RandomTriangulation(70, embed=True)
 ---------------------------------------------------------------------------
 KeyError                                  Traceback (most recent call
 last)
 <ipython-input-44-2d58770e9f2f> in <module>()
 ----> 1 get_ipython().magic(u'time g = graphs.RandomTriangulation(70,
 embed=True)')

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
    2203         magic_name, _, magic_arg_s = arg_s.partition(' ')
    2204         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
 -> 2205         return self.run_line_magic(magic_name, magic_arg_s)
    2206
    2207
 #-------------------------------------------------------------------------

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/IPython/core/interactiveshell.pyc in run_line_magic(self,
 magic_name, line)
    2124                 kwargs['local_ns'] =
 sys._getframe(stack_depth).f_locals
    2125             with self.builtin_trap:
 -> 2126                 result = fn(*args,**kwargs)
    2127             return result
    2128

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/IPython/core/magics/execution.pyc in time(self, line, cell,
 local_ns)

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
     191     # but it's overkill for just that one bit of state.
     192     def magic_deco(arg):
 --> 193         call = lambda f, *a, **k: f(*a, **k)
     194
     195         if callable(arg):

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/IPython/core/magics/execution.pyc in time(self, line, cell,
 local_ns)
    1127         else:
    1128             st = clock2()
 -> 1129             exec(code, glob, local_ns)
    1130             end = clock2()
    1131             out = None

 <timed exec> in <module>()

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/sage/graphs/generators/random.pyc in RandomTriangulation(n,
 embed)
     835
     836     # extract the 1-skeleton
 --> 837     g = P.vertex_graph()
     838     g.rename('Planar triangulation on {} vertices'.format(n))
     839     if embed:

 /Users/dcoudert/sage/src/sage/misc/cachefunc.pyx in
 sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__
 (build/cythonized/sage/misc/cachefunc.c:13663)()
    2207         if self.cache is None:
    2208             f = self.f
 -> 2209             self.cache = f(self._instance)
    2210         return self.cache
    2211

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/sage/geometry/polyhedron/base.pyc in vertex_graph(self)
    2933             True
    2934         """
 -> 2935         return Graph(self.vertex_adjacency_matrix(), loops=False)
    2936
    2937     graph = vertex_graph

 /Users/dcoudert/sage/src/sage/misc/cachefunc.pyx in
 sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__
 (build/cythonized/sage/misc/cachefunc.c:13663)()
    2207         if self.cache is None:
    2208             f = self.f
 -> 2209             self.cache = f(self._instance)
    2210         return self.cache
    2211

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/sage/geometry/polyhedron/base.pyc in
 vertex_adjacency_matrix(self)
    1638             (0, 0, 1, 1, 0) A vertex at (3, 0)
    1639         """
 -> 1640         return self._vertex_adjacency_matrix()
    1641
    1642     adjacency_matrix = vertex_adjacency_matrix

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/sage/geometry/polyhedron/base.pyc in
 _vertex_adjacency_matrix(self)
     286             M[j,i]=1
     287
 --> 288         face_lattice = self.face_lattice()
     289         for face in face_lattice:
     290             Vrep = face.ambient_Vrepresentation()

 /Users/dcoudert/sage/src/sage/misc/cachefunc.pyx in
 sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__
 (build/cythonized/sage/misc/cachefunc.c:13663)()
    2207         if self.cache is None:
    2208             f = self.f
 -> 2209             self.cache = f(self._instance)
    2210         return self.cache
    2211

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/sage/geometry/polyhedron/base.pyc in face_lattice(self)
    2815         return Hasse_diagram_from_incidences\
    2816             (atoms_incidences, coatoms_incidences,
 -> 2817              face_constructor=face_constructor,
 required_atoms=atoms_vertices)
    2818
    2819     def faces(self, face_dimension):

 /Users/dcoudert/sage/local/lib/python2.7/site-
 packages/sage/geometry/hasse_diagram.pyc in
 Hasse_diagram_from_incidences(atom_to_coatoms, coatom_to_atoms,
 face_constructor, required_atoms, key, **kwds)
     188     # Make sure that coatoms are in the end in proper order
     189     tail = [faces[atoms, frozenset([coatom])]
 --> 190             for coatom, atoms in enumerate(coatom_to_atoms)]
     191     tail.append(faces[A, frozenset()])
     192     new_order = [n for n in new_order if n not in tail] + tail

 KeyError: (frozenset([]), frozenset([132]))
 }}}

 David.

--
Ticket URL: <http://trac.sagemath.org/ticket/10276#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to