Skip to content

feat: Construct::TightInsertion, soft bounds held hard while constructing - #29

Open
thiagomoretto wants to merge 1 commit into
soft-constraintsfrom
soft-construct-tight
Open

thiagomoretto wants to merge 1 commit into
soft-constraintsfrom
soft-construct-tight

Conversation

@thiagomoretto

Copy link
Copy Markdown
Owner

Stacked on #28. Opt-in, default behaviour unchanged.

What

Construct::TightInsertion { seed, k }: cheapest insertion with every soft bound treated as hard for as long as every unrouted node still fits under them. Once a node fits nowhere tightly, construction loosens and stays loose. The first solution pays no penalty when a penalty-free one is reachable.

bench --scenario=softcap --tight runs a scenario from it.

Why opt-in

The priced greedy overloads a route early wherever one unit of excess is cheaper than a detour, and the descent does not always unload it (X-n106 sat 5% above the open solve on #28). Tight construction fixes that shape but hurts the other one.

Measured on X-n1xx, tight vs priced construction:

scenario hill climb GLS 30
softcap 15 better / 6 worse, sum -3875 13 / 8, sum -812
softtw 10 better / 8 worse, sum +2206 10 / 8, sum +3011
plain CVRP identical identical

X-n106 softcap lands exactly on open, X-n195 2393 under it. Softtw regresses because a single-customer route always meets a soft close, so tight construction opens extra routes instead of buying a cheap late slot.

Tests

tests/soft.rs: tight construction is penalty-free where the priced greedy overloads, and still routes a node that can never meet its soft bound.

…ting

The priced greedy overloads a route early wherever one unit of excess is
cheaper than a detour, and the descent does not always unload it. With
soft bounds held hard until a node fits nowhere under them, the first
solution pays no penalty when a penalty-free one is reachable.

Opt-in: it suits overload-style softness (softcap lands on or under the
open solve) and hurts window-style, where a single-customer route always
meets a soft close and construction opens routes it need not.
`bench --scenario=... --tight` runs a scenario from it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant