Code Monkey home page Code Monkey logo

Comments (5)

leonlan avatar leonlan commented on July 18, 2024 1

Thanks, But I still have a question: there are several select strategies and accept criterions. The first idea is to make a combination with these strategy, but it will take a lot of time. Is there a priority for these policies( select and accept strategy)?

I'm not sure if I understand you correctly here. Do you mean if there is any recommended selection scheme and acceptance criterion combination? If so, then yes: the vehicle routing literature generally uses the RouletteWheel selection scheme combined with the SimulatedAnnealing acceptance criterion. But if you are trying to solve a different problem, then it may be that there are other combinations that work better. This is indeed time consuming to figure out, but there is no general answer to which combination works best besides running numerical experiments.

from alns.

N-Wouda avatar N-Wouda commented on July 18, 2024 1

If so, then yes: the vehicle routing literature generally uses the RouletteWheel selection scheme combined with the SimulatedAnnealing acceptance criterion.

[To be fair, particularly the (segmented) roulette wheel is used a lot largely due to inertia/lack of interest in experimenting with alternatives. I doubt it's actually the best method for operator selection - it's just the first thing that's been suggested in the literature.]

from alns.

rlacjfjin avatar rlacjfjin commented on July 18, 2024 1

Thanks.
I have no other questions.

from alns.

leonlan avatar leonlan commented on July 18, 2024

Hi Zhe,

In addition to customizing the structure of the solution, destroy and repair operators, Isn't there a need to consider other modules(select, accept and stop conditions)?

The most important ingredients for your ALNS heuristic are the solution states and the destroy/repair operators. You don't have to implement your own operator selection scheme, acceptance criterion or stopping criteria, because we have already implemented the most common ones from the literature (RouletteWheel, SimulatedAnnealing, etc.). You could customize your own selection scheme or acceptance criterion, but that is generally less impactful than implementing good destroy/repair operators.

For the stop criterion, can it be mixed to use(for example, under the time limit condition, because the solution for the improvement is not found for a long time, it is terminated early)? If so, are there any examples to refer to?

We have not provided any interface yet to mix stopping criteria, but this should do the trick:

from typing import List

from numpy.random import RandomState

from alns.State import State
from alns.stop.StoppingCriterion import StoppingCriterion


class MixedStop(StoppingCriterion):
    """
    Criterion that stops after a specified maximum runtime.
    """

    def __init__(self, stopping_criteria: List[StoppingCriterion]):
        self.stopping_criteria = stopping_criteria

    def __call__(self, rnd: RandomState, best: State, current: State) -> bool:
        """
        Returns true if at least one of the initialized stopping criteria is satisfied.
        """
        return any(stop(rnd, best, current) for stop in self.stopping_criteria)


from als.stop import NoImprovement, MaxRuntime

stop1 = NoImprovement(10000)
stop2 = MaxRuntime(100)

# This criterion stops when the best solution has not been improved for 10K
# or after 100 seconds of runtime.
stop = MixedStop([stop1, stop2])

Are there any articles on similar trade-offs in terms of choosing weights? (Similar to stop criterion)

I don't know of any articles specifically analyzing the choice of weights, but you might be interested in this paper

If I want to improve the solver, in addition to the custom module, is it focus on how to choose the weight(such as learn select weights)?

That is one possible direction, yes. You could also implement your own custom operator selection scheme (see paper above).

Let me know if you have any other questions!

from alns.

rlacjfjin avatar rlacjfjin commented on July 18, 2024

Thanks,
But I still have a question:
there are several select strategies and accept criterions. The first idea is to make a combination with these strategy, but it will
take a lot of time. Is there a priority for these policies( select and accept strategy)?

from alns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.