#12134: is_planar(set_pos=True) doesn't work with small graphs
----------------------------+-----------------------------------------------
Reporter: brunellus | Owner: jason, ncohen, rlm
Type: defect | Status: new
Priority: major | Milestone: sage-4.8
Component: graph theory | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
----------------------------+-----------------------------------------------
Comment(by brunellus):
{{{
sage: graphs.PathGraph(3).is_planar(set_pos=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_30.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("Z3JhcGhzLlBhdGhHcmFwaCgzKS5pc19wbGFuYXIoc2V0X3Bvcz1UcnVlKQ=="),globals())+"\\n");
execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpcidEK0/___code___.py", line 3, in <module>
exec compile(u'graphs.PathGraph(_sage_const_3
).is_planar(set_pos=True)
File "", line 1, in <module>
File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-
packages/sage/graphs/generic_graph.py", line 2572, in is_planar
planar =
is_planar(G,kuratowski=kuratowski,set_pos=set_pos,set_embedding=set_embedding)
File "planarity.pyx", line 143, in sage.graphs.planarity.is_planar
(sage/graphs/planarity.c:1574)
File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-
packages/sage/graphs/generic_graph.py", line 2760, in set_planar_positions
self.layout(layout = "planar", save_pos = True, test = test,
**layout_options)
File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-
packages/sage/graphs/generic_graph.py", line 12753, in layout
pos = getattr(self, "layout_%s"%layout)(dim = dim, **options)
File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-
packages/sage/graphs/generic_graph.py", line 2859, in layout_planar
extra_edges = _triangulate( G, G._embedding)
File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-
packages/sage/graphs/schnyder.py", line 67, in _triangulate
if len(g.neighbors(vertex_list[0]) == 2): # figure our which
of the vertices already has two neighbors
TypeError: object of type 'bool' has no len()
}}}
Ufff... For longer paths it seems fine. This error is also dependent on
set_pos=True.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12134#comment:1>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.