dwavesystems / dwave-samplers

Classical algorithms for solving binary quadratic models
Apache License 2.0
8 stars 12 forks source link

Tabu documentation of timeout and num_reads inaccurate, not clear what is happening. #25

Closed jackraymond closed 2 years ago

jackraymond commented 2 years ago
samples = tabu_sampler.sample_ising(h = {'a': -0.5, 'b': 1.0}, J = {'ab ': -1},num_restarts = 0,num_reads=100,timeout=1000)

We anticipate the runtime of this algorithm to be close to timeout*num_reads according to the MST2 reference (no restarts - STS(), which should run until a timeout condition is met). However, it seems to be more than 2 orders of magnitude shorter and basically independent of timeout.

Perhaps a max number of iterations (z) is silently hardcoded per restart? I've varied, num_restarts, tenure, num_reads and complexity (size and level of frustration) of the ising model without recovering the expected behavior.

jackraymond commented 2 years ago

https://github.com/dwavesystems/dwave-samplers/blob/2dc692a92ca7f56c61f17de0440b488a3aed3bb9/dwave/samplers/tabu/src/tabu_search.cpp#L80

Seems like z is hardcoded and it shouldn't be, this should be an exposed parameter and also a useful alternative to timeout

jackraymond commented 2 years ago

I'll make a pull request to correct this.

arcondello commented 2 years ago

Closed by https://github.com/dwavesystems/dwave-samplers/pull/26