Open gdalle opened 3 weeks ago
Even more surprising, it's the same with matrix from files:
julia> using MatrixMarket
julia> MatrixMarket.mmwrite("J.mtx", J)
julia> for i in 1:10
println(maximum(get_colors(ColPackPartialColoring("J.mtx", "COLUMN_PARTIAL_DISTANCE_TWO", "NATURAL"))))
end
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
22
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
23
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
22
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
20
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
22
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
24
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
23
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
23
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
22
Found file J.mtx
Graph of Market Market type: [matrix coordinate real general]
22
I just checked that the command line interface of ColPack consistently returns a coloring with 19 colors for that setup, so the problem lies with our Julia - C++ bindings
I checked with the PR #22 and I confirm:
using ColPack, SparseArrays, StableRNGs
using MatrixMarket
J = sprand(StableRNG(63), 100, 200, 0.04)
MatrixMarket.mmwrite("./myfile.mtx", J)
for i in 1:10
colpack("./myfile.mtx", "ROW_PARTIAL_DISTANCE_TWO", "NATURAL")
end
for i in 1:10
colpack("./myfile.mtx", "COLUMN_PARTIAL_DISTANCE_TWO", "NATURAL")
end
for i in 1:10
obj = ColPackPartialColoring(J, "ROW_PARTIAL_DISTANCE_TWO", "NATURAL")
ncolors(obj) |> println
end
for i in 1:10
obj = ColPackPartialColoring(J, "COLUMN_PARTIAL_DISTANCE_TWO", "NATURAL")
ncolors(obj) |> println
end
What do you confirm? That the binary is deterministic and we screwed up somewhere else in the interface?
What do you confirm? That the binary is deterministic and we screwed up somewhere else in the interface?
Yes, I did something wrong in the C interface.
Is there an explanation for coloring to be non-deterministic with the natural order?