I am trying to use LightGraphs.SimpleGraphs.random_regular_digraph Method

to create a regular random digraph. Julia version is 1.6.0 on Red Hat Linux. I am running on a single thread. I am very tired tonight but this just look plain wrong

julia> using LightGraphs

julia> adjacency_matrix(random_regular_digraph(10, 4))

10×10 SparseArrays.SparseMatrixCSC{Int64, Int64} with 40 stored entries:

⋅ 1 1 ⋅ 1 ⋅ ⋅ 1 ⋅ ⋅

⋅ ⋅ ⋅ ⋅ ⋅ 1 ⋅ 1 1 1

⋅ ⋅ ⋅ 1 ⋅ 1 ⋅ 1 ⋅ 1

⋅ ⋅ ⋅ ⋅ ⋅ 1 1 1 1 ⋅

⋅ 1 1 ⋅ ⋅ 1 ⋅ 1 ⋅ ⋅

⋅ ⋅ ⋅ 1 ⋅ ⋅ 1 1 ⋅ 1

⋅ ⋅ 1 1 ⋅ ⋅ ⋅ 1 1 ⋅

⋅ 1 ⋅ ⋅ 1 1 ⋅ ⋅ 1 ⋅

⋅ ⋅ ⋅ 1 ⋅ 1 1 1 ⋅ ⋅

⋅ ⋅ 1 1 ⋅ ⋅ ⋅ 1 1 ⋅

Am I hallucinating or in-degrees (column sums) are messed up? I hope I am wrong as usual but in the case, this turns out to be a real bug I would love to work with a package developer to implement the state-of-the-art algorithm. I would be happy to post more references but this would be the starting point

[1511.01175] Uniform generation of random regular graphs

Oh, and in case you wonder I tried with Erdos fork of the above package as well.

julia> using Erdos

julia> adjacency_matrix(random_regular_digraph(10, 4))

10×10 SparseArrays.SparseMatrixCSC{Int64, Int64} with 40 stored entries:

⋅ 1 ⋅ 1 1 ⋅ ⋅ ⋅ 1 ⋅

⋅ ⋅ 1 ⋅ 1 ⋅ 1 1 ⋅ ⋅

⋅ 1 ⋅ ⋅ 1 1 ⋅ ⋅ 1 ⋅

⋅ ⋅ 1 ⋅ 1 ⋅ 1 ⋅ ⋅ 1

⋅ 1 ⋅ ⋅ ⋅ ⋅ 1 1 ⋅ 1

⋅ ⋅ 1 1 ⋅ ⋅ 1 ⋅ ⋅ 1

⋅ 1 1 ⋅ 1 ⋅ ⋅ 1 ⋅ ⋅

⋅ 1 1 ⋅ 1 ⋅ ⋅ ⋅ 1 ⋅

⋅ 1 ⋅ ⋅ 1 1 1 ⋅ ⋅ ⋅

⋅ ⋅ ⋅ ⋅ 1 1 1 1 ⋅ ⋅