Skip to content

Random related problem? #929

@ThomasBreuer

Description

@ThomasBreuer

In the discussion of my issue gap-packages/walrus/issues/38 for the walrus package, @james-d-mitchell asked whether the problem is in fact in the Digraphs package. Meanwhile I think that the answer is yes.

The problem shows up in a test example that constructs RandomDigraph(100, 0.05). The underlying function is RANDOM_DIGRAPH, which calls the function rand from the standard C library. As far as I understand, its results are not reproducible in the sense that the random number generator is set to some default value in the beginning.
Note that GAP's Test function initializes the global random sources (GlobalMersenneTwister) in the beginning of the tests, in order to make the test results reproducible.

Is this behaviour of RANDOM_DIGRAPH intended?
Would it perhaps make sense to admit a random source as an optional argument of RandomDigraph, such that one can make test results reproducible?
In any case, the documentation of RandomDigraph should state what the meaning of "random" is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues, bugs, pull requests relating to the documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions