Skip to content

Warm-starting from previous solutions #710

Closed Answered by johege
johege asked this question in Q&A
Discussion options

You must be logged in to vote

That's right. I thought about using the whole previous population. I just wasn't familiar enough with the code yet to do that.
I think I have that implemented now:

def solve(new_data, prev_pop=None, max_runtime=60, seed=42):
    rng = RandomNumberGenerator(seed=seed)
    pm = PenaltyManager.init_from(new_data)
    pop = Population(broken_pairs_distance)

    neighbours = compute_neighbours(new_data)
    ls = LocalSearch(new_data, rng, neighbours)

    for node_op in NODE_OPERATORS:
        ls.add_node_operator(node_op(new_data))

    for route_op in ROUTE_OPERATORS:
        ls.add_route_operator(route_op(new_data))

    if prev_pop:
        init = []
        for sol in prev_pop:
            

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@N-Wouda
Comment options

@johege
Comment options

@N-Wouda
Comment options

@johege
Comment options

Answer selected by N-Wouda
@N-Wouda
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants