#15706: Graph built from their edges are simple by default
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.4
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:  graph  |    Reviewers:
  theory                 |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  f6087ffcf2370bdfe45a1162c7d7106c9829ad5c
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/ncohen/15706         |
   Dependencies:         |
  #15704                 |
-------------------------+-------------------------------------------------

Comment (by ncohen):

 Yo !

 > Well, like I said, I'm not sure I want to change that behavior or not.
 It seems like the kind of thing that should be discussed at some length.

 Well... I would be glad to discuss it at length with anybody but this
 ticket has been here for 10 months already....

 > I do agree there should be a flag to avoid the runtime cost, that seems
 clear - but again, I am agnostic on the ''default''.

 Well... Again, all graph books usually begin by saying that all graphs
 considered are simple, i.e. no loops nor multiple edges. There is such a
 thing as "multigraph", too. And I really don't like this behaviour:

 {{{
 sage: G=Graph([(1,2),(1,2),(1,1)]); G.edges()
 [(1, 1, None), (1, 2, None), (1, 2, None)]
 sage: G=Graph(); G.add_edge(1,2); G.add_edge(1,2); G.add_edge(1,1);
 G.edges()
 [(1, 2, None)]
 }}}

 Somehow the current behaviour of `add_edge` depends on non-explicit
 information, and considers simple graphs as the default. I would feel
 better if everybody got used to state clearly what they want to work with
 and dealt with the consequences. A guy who wants to build multigraphs and
 initializes them from a list of edges will experience seriously
 inconsistent behaviour depending on whether the initial information
 contains multiple edges and/or loops !

 > As a constructive comment, maybe one ticket could be to have a flag (how
 that is named, I don't know) and then this one for making defaults,
 assuming there is something approaching consensus.

 Hmmmmm.... Well, what do you expect consensus to look like when it seems
 after 10 months that only one person cares ? `:-P`

 Nathann

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