Oh, I forgot : it is indeed weird that "faces" may not exist in your version of Sage even though trace_faces is already deprecated,but everything seems to be fine in Sage 6.2.beta5. Sorry for that, I don't know where it comes from, but it will be fixed if you update your install :-)
Nathann On 28 March 2014 15:08, Nathann Cohen <nathann.co...@gmail.com> wrote: > Hellooooooooooooo ! > >> >> for a simple graph, trace_faces() gives the expected answer for the faces >> of a planar graph > > > That's a good news :-D > >> the face that should exist between just nodes 3,4 and 5 is not found, >> it's replaced with a face around nodes 1,2,3,4,5. Any ideas what is wrong, >> or other ways of getting an accurate list of the faces in a planar graph? > > What makes you think that the faces returned by Sage are wrong ? A planar > graph can have different planar embeddings, and so different sets of faces. > > If you call .show() with a specific position for the vertices, this may > result in a planar graph and you may see some faces defined, but there is no > reason why .trace_faces() should return the faces using the positions you > defined earlier for the plot ! > > In the documentation, .trace_faces() tells you that it can either find the > embedding by itself, or use an "embedding" argument. In you case you did not > define the embedding, so trace_faces() finds its own. > > As, just before, you called .is_planar(set_embedding=True), the embedding > used by traces_faces() is the one that has been found by is_planar. But as > you did not give to is_planar() the position of your vertices (and it does > not accept positions of vertices as an input anyway),then is computes its > own embedding. That's all. > > So unless you think that the faces returned by Sage do not correspond to a > planar embedding, technically Sage makes no error. > > Now, if you want Sage to work with the position of the vertices you used for > the plot, what you should do is write a short function which transforms > (x,y) positions for the vertices into a combinatorial embedding. Then, you > will be able to call .set_embedding() with that embedding, and then > trace_faces() will give you the result that you expect, i.e. the faces > defined by your embedding. > > And if you do that, please contribute to Sage by submitting your code, as I > guess this would definitely be useful to others :-) > > Good luuuuuuuuuuuuuuuuuuuuuuuuuuuck ! > > Nathann > > >> >> >> >> I'm using 'Sage Version 5.13, Release Date: 2013-12-15' >> >> I realize that trace_faces has been deprecated to just faces() per this >> discussion: http://trac.sagemath.org/ticket/15551 >> >> but when I run >> S.faces() >> >> I get the error >> AttributeError: 'Graph' object has no attribute 'faces' > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sage-support" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sage-support/X8hc0AlTCB8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- 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 sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.