William, Sorry about the failed tests. I'm not sure why XGraphs take up 50% more space than Graphs: for an unlabelled graph, the adjacency dicts are the same:
sage: import networkx sage: N = graphs.PetersenGraph().networkx_graph() sage: N <networkx.xgraph.XGraph object at 0x9bade10> sage: N2 = networkx.Graph(N) sage: N2 <networkx.graph.Graph object at 0x9bad790> sage: N.adj {0: {1: None, 4: None, 5: None}, 1: {0: None, 2: None, 6: None}, 2: {1: None, 3: None, 7: None}, 3: {2: None, 4: None, 8: None}, 4: {0: None, 3: None, 9: None}, 5: {0: None, 7: None, 8: None}, 6: {1: None, 8: None, 9: None}, 7: {2: None, 5: None, 9: None}, 8: {3: None, 5: None, 6: None}, 9: {4: None, 6: None, 7: None}} sage: N2.adj {0: {1: None, 4: None, 5: None}, 1: {0: None, 2: None, 6: None}, 2: {1: None, 3: None, 7: None}, 3: {2: None, 4: None, 8: None}, 4: {0: None, 3: None, 9: None}, 5: {0: None, 7: None, 8: None}, 6: {1: None, 8: None, 9: None}, 7: {2: None, 5: None, 9: None}, 8: {3: None, 5: None, 6: None}, 9: {4: None, 6: None, 7: None}} The labels for edges just take the place of the None entries. I'm actually not sure why NetworkX has two classes at all. -Robert M On 1/23/07, William Stein <[EMAIL PROTECTED]> wrote: > Robert, > > Make sure to do hg_sage.pull() before working further on the graph code, > since I fixed a bunch of problems that were introduced. > > (1) Tons of doctests were broken by your changes. > I fixed them all. In the future, though, you should > *always* do "sage -t " in the graphs directory before > sending me anything, and make sure all tests pass. > > (2) I made sure the examples in the tutorial you wrote get > doctested. > > (3) I fixed some bug related to printing... > > (4) I programmed around a weird bug in printing where self._nxg.name > sometimes didn't get set. (?) > > Also, I have a question or worry. Robert, you seem to have changed > *all* graphs in SAGE to have to be labeled. This means that unlabeled > graphs now take 50% more space to store than they used to. Are you sure > it is a good idea that all graphs *have* to be labeled by default, > especially given that NetworkX is not designed that way. Just curious. > > William > -- Robert L. Miller http://www.robertlmiller.com/ --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---