#19381: Refactor Graph.__init__
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.9
  defect                 |   Resolution:
       Priority:  major  |    Merged in:
      Component:  graph  |    Reviewers:
  theory                 |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  a74b0ff454c22237989edef3078ae55552ccf02e
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/ncohen/19381         |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by tscrim):

 Would it be possible in this ticket to add support for constructing a
 graph by `[V, E]` like this:
 {{{
 sage: V = [1,2,3,4]
 sage: E = [[1,2]]
 sage: Graph([V, E])
 }}}
 I know I can do it like this
 {{{
 sage: G = Graph({1:[2], 2:[], 3:[], 4:[]})
 sage: G.vertices()
 [1, 2, 3, 4]
 }}}
 but this is somewhat cumbersome (and doesn't work for graphs with labeled
 (multiple) edges). The other way I know how to do this is I have to pass
 the edge set, then add the vertices.

 The reason I ask is because I have wanted to create immutable graphs with
 larger vertex sets than the connectivity of the edges and I don't want to
 have to waste time copying a mutable graph backend into the static
 backend. (As an additional reason, it also follows the basic intro to
 combinatorics definition of a graph.)

 I should also be able to review this ticket too (and I definitely will if
 you make the above change).

--
Ticket URL: <http://trac.sagemath.org/ticket/19381#comment:2>
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