[sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-30 Thread etcoon
Haha, apologies for screwing up the review process. To continue from the previous posts, if you first re-order the embedding to actually be clockwise, then the trace_faces() method works as expected: import numpy def reorder_embedding(emb, locs): new_emb = {} for i,neighbors in

[sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-30 Thread etcoon
On Wednesday, March 26, 2014 5:34:53 PM UTC-6, Christa Brelsford wrote: for a simple graph, trace_faces() gives the expected answer for the faces of a planar graph, as shown below. import networkx as nx lat = nx.Graph() lat.add_edge(1,2) lat.add_edge(2,3) lat.add_edge(2,5)

[sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-30 Thread etcoon
On Wednesday, March 26, 2014 5:34:53 PM UTC-6, Christa Brelsford wrote: for a simple graph, trace_faces() gives the expected answer for the faces of a planar graph, as shown below. import networkx as nx lat = nx.Graph() lat.add_edge(1,2) lat.add_edge(2,3) lat.add_edge(2,5)

[sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-30 Thread etcoon
The problem is not in the trace_faces() method, but in the is_planar() calculation. The embedding of the second graph is not correct: S = Graph(lat) S.show(vertex_size = 600, pos = nodes_dict) S.is_planar(set_embedding = True) s_emb = S.get_embedding() print s_emb {1: [2], 2: [1, 3, 5], 3: [4,

Re: [sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-30 Thread Nathann Cohen
The problem is not in the trace_faces() method, but in the is_planar() calculation. The embedding of the second graph is not correct: The is_planar method does not take the nodes_dict dictionary as an input. Why do you say that its output is incorrect ? Nathann -- You received this message

Re: [sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-28 Thread Nathann Cohen
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

[sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-28 Thread Nathann Cohen
Hello ! 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

[sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-28 Thread Christa Brelsford
Nathann, Thanks for your help! I'm fairly new to both Sage and graph theory, but I understand the difference you point out, and it looks like the trace faces function is giving me accurate faces for some valid planar embedding- just not the one I thought it was working on. I spoke with a

Re: [sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-28 Thread Tom Boothby
Christa, The problem is not with the code, but your expectations of it (which may be valid, but that would be a feature request and not a bug). You expect the code to look at your planar position dictionary, and gin up an embedding from that. That is not a bad idea, and possibly a good feature