N-Wouda / ALNS

Adaptive large neighbourhood search (and more!) in Python.
https://alns.readthedocs.io/en/latest/
MIT License
423 stars 122 forks source link

Are TA and RRT the same? #86

Closed rlacjfjin closed 2 years ago

rlacjfjin commented 2 years ago

As the title

N-Wouda commented 2 years ago

@rlacjfjin thanks for opening an issue!

I find it difficult to understand your question. What's the same as what? Can you perhaps rephrase, or explain in more detail?

rlacjfjin commented 2 years ago

I think ThresholdAccept and RecordToRecordTravel are same codes in call function. Is it true?

N-Wouda commented 2 years ago

No, TA compares against the current solution; RRT against the global best:

>>>diff RecordToRecordTravel.py ThresholdAccept.py

<     def __call__(self, rnd, best, current, candidate):
<         # This follows from the paper by Dueck (1993), p. 87.
<         result = (candidate.objective() - best.objective()) <= self._threshold
---
>     def __call__(self, rnd, best, curr, cand):
>         # This follows from the paper by Dueck and Scheueur (1990), p. 162.
>         res = cand.objective() - curr.objective() <= self._threshold

Do note that these APIs are not yet set in stone - they are not yet released. In particular, I suspect we might merge RRT and TA into one class, and have the behaviour depend on a parameter.

rlacjfjin commented 2 years ago

I'm following your project, and I see new submissions. I've checked what has changed, sorry for disturbing you. It's ok now, thanks

N-Wouda commented 2 years ago

No worries, I am glad we could clear this up!