#18828: Export graph to file
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.8
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:  graph  |    Reviewers:
  theory                 |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  f7c4a18508cf66a958ffe3110754916d406c0ee3
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/ncohen/18828         |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by dcoudert):

 This method is clearly useful. It is too boring to import networkx each
 time you want to read/write a graph from/to a file.
 > >  * could you make a test that checks if the output is correct?
 >
 > I added one check, but it is unpleasant in many ways. First, the
 (integer) vertices become strings, and then each edge gets a label
 encoding a weight. Well, that's networkx...

 By default method `networx.write_edgelist` sets parameter `data=True`. So
 your method produce a weighted edgelist instead of an edgelist
 {{{
 0 1 {}
 }}}
 instead of
 {{{
 0 1
 }}}
 I understand that you prefer short and fast code, but since writing to a
 file is slow anyway, we could spend some computation time to refine the
 behavior of the method.

 David

--
Ticket URL: <http://trac.sagemath.org/ticket/18828#comment:9>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to