Skip to content

Help with CVRP Reload #2442

Mar 16, 2021 · 3 comments · 10 replies
Discussion options

You must be logged in to vote

Simply add

    # Vehicles must be empty upon arrival
    capacity_dimension = routing.GetDimensionOrDie("Capacity")
    for v in range(manager.GetNumberOfVehicles()):
        print(f"vehicle {v}")
        end = routing.End(v)
        #routing.solver().Add(capacity_dimension.CumulVar(end) == 0) # see comment below
        capacity_dimension.SetCumulVarSoftUpperBound(end, 0, 100_000)

possible output:

./2442_unload.py
...
I0417 23:53:02.181640 17437 search.cc:260] Solution #317 (372696, objective maximum = 4838552, time = 2969 ms, branches = 3223, failures = 940, depth = 33, MakeInactiveOperator, neighbors = 265820, filtered neighbors = 317, accepted neighbors = 317, memory used = 14.93 MB, …

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
7 replies
@Amarjeet0890
Comment options

@mertbakir
Comment options

@Amarjeet0890
Comment options

@mertbakir
Comment options

@mertbakir
Comment options

Comment options

You must be logged in to vote
2 replies
@Mizux
Comment options

@mertbakir
Comment options

Comment options

You must be logged in to vote
1 reply
@mertbakir
Comment options

Answer selected by mertbakir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #2441 on March 16, 2021 13:37.