[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,