coin-or / coin-or/CoinUtils

Issues with random generator (Windows MSVC vs. Linux)

Open
#141 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
53
Forks
47
PR merge metrics
No merged PRs in 30d

Description

At work, we generate "a lot" of ILP based on large graphs.

We always ran into the issue that some solve perfectly well on Linux but not at all on Windows.

(with exactly the same solver code & 64-bit machines for both systems)

I investigated this a bit more and found out the biggest impact has the random generator.

With the default seed of 1234567, e.g.

[value_24093348.lp.gz](https://github.com/coin-or/CoinUtils/files/5873306/value_24093348.lp.gz)

our solver driver with some

CbcMain1 call with the parameters

"-strong=0", "-probing=on", "-feas=off", "-cuts=on", "-PassCuts=100" "-solve"

isn't able to handle this at all on Windows.

With small seeds this seems to work more reasonable.

Given the random generator is hand-written, I tried to use one that a C++11 compiler library provides.

This seems to at least bring more "consistent" results on Linux & Windows (and macOS)

A difference is that the generated numbers are in [0.0, 1.0[ but that seems to work for our stuff, but perhaps that is an issue in general.

See below attached rng path as proof of concept.

[rng.txt](https://github.com/coin-or/CoinUtils/files/5873363/rng.txt)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the provided value_24093348.lp.gz case with the CbcMain1 parameters listed in the issue on Windows and Linux. Compare the current hand-written random generator with the C++11 approach shown in rng.txt, including the [0.0, 1.0[ range. Done should mean the seeded behavior is consistent across the reported platforms without breaking existing solver expectations.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.