#12181: random_DAG does not terminate on it's default inputs
------------------------------------------+---------------------------------
       Reporter:  mderickx                |         Owner:  tbd          
           Type:  defect                  |        Status:  needs_work   
       Priority:  major                   |     Milestone:  sage-5.3     
      Component:  graph theory            |    Resolution:               
       Keywords:  random digraph          |   Work issues:               
Report Upstream:  N/A                     |     Reviewers:  David Coudert
        Authors:  dsm, Frédéric Chapoton  |     Merged in:               
   Dependencies:                          |      Stopgaps:               
------------------------------------------+---------------------------------
Changes (by dcoudert):

  * status:  needs_review => needs_work
  * reviewer:  => David Coudert


Comment:

 Hello,

 The patch needs further improvements.

 1) The test on p should be improved since I can give p=2 without error.
 For instance,
 {{{
 if p < 0 or p > 1:
    raise ValueError('The parameter p must be in [0..1].')
 }}}

 2) A test is needed for parameter weight_max:
 {{{
 sage: random_DAG(5, .5, -1)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 ...
 ...
 ValueError: empty range for randrange() (1,0, -1)
 }}}
 and
 {{{
 sage: random_DAG(5, .5, .5)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 ...
 ...
 ValueError: non-integer stop for randrange()
 }}}

 3) It should be clearly indicated in the documentation that the function
 returns a dictionary storing the edges of the DAG.

 4) The resulting number of vertices is not n but n+1:
 {{{
 sage: d = DiGraph(random_DAG(5, .5))
 sage: d
 Digraph on 6 vertices
 }}}

 5) I don't understand why this digraph generator is not part of
 ```sage.graphs.digraph_generators.py```. The function could have an
 optional parameter to return a dictionary instead of a digraph if
 relevant.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12181#comment:15>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to