Skip to content

docs: [docs-drift] nearby-multiple-matrices - #2878

Open
timefold-automations[bot] wants to merge 1 commit into
mainfrom
docs-drift/nearby-multiple-matrices
Open

timefold-automations[bot] wants to merge 1 commit into
mainfrom
docs-drift/nearby-multiple-matrices

Conversation

@timefold-automations

Copy link
Copy Markdown
Contributor

Merged group: TimefoldAI/timefold-solver-enterprise#974 by triceo. The Community Edition counterpart is #2842, also by triceo. It is on the same branch and already merged. It added the section "Several distance matrices" and the upgrade note "Nearby selection also measures the trip back".

Finding 1: list change and sub-list change rank by the trip back only

  • The code change: TimefoldAI/timefold-solver-enterprise, core/src/main/java/ai/timefold/solver/enterprise/core/nearby/list/ListNearbyDistanceMatrixDemand.java (new getRanking() returns NearbyRanking.CHANGE_LEG) and .../nearby/list/SubListNearbyDistanceMatrixDemand.java (same). NearbyRanking.CHANGE_LEG is defined in .../nearby/common/NearbyRanking.java. Kind: changed behaviour. Before this PR, ListVariableNearbyDistanceMatrix.addAllDestinations() ranked each destination by getNearbyDistance(origin, destination). Now list change and sub-list change rank a value destination by getNearbyDistance(destination, origin), which is only the trip from the neighbor to the moved item. A vehicle destination still uses moved item to vehicle. Basic change keeps ORIGIN_TO_DESTINATION. Swaps and k-opt use both directions (SWAP_LEGS).

  • The docs location:

    • docs/src/modules/ROOT/pages/optimization-algorithms/move-selector-reference.adoc:842: "Where a move also needs the trip back, the solver calls the meter with the neighbor as the moved item."
    • docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-to-latest.adoc:99: "Nearby selection now also measures the trip back…"

    Both sentences say the trip back is measured in addition to the trip from the moved item. For list change and sub-list change, the trip back now replaces that trip. A user with an asymmetric meter cannot learn from these pages that these moves now rank in the opposite direction.

  • Confidence: medium. Prose describes behaviour that changed.

  • What I changed: I added one sentence after each of the two sentences quoted above. Each new sentence says that a list change or sub-list change to a neighbor value measures only the trip back, because the move puts the moved item right after the neighbor.

Checked, no drift

  • Matrix count range: NearbyMeterInitializationDemand allows 1 to 16 matrices and fails fast outside that range. This matches "Return a matrix count from one to 16".
  • Size maximum: random selection with more than one matrix fails fast without a size maximum, and a block distribution needs blockDistributionUniformDistributionProbability set to 0. This matches the rule in the docs.
  • Partitioned search: DefaultPartitionedSearchPhase now gives each partition its own ClassInstanceCache. This matches "each partition has its own meter instance".
  • Plain meters: a plain NearbyDistanceMeter is wrapped by NearbyDistanceMeterAdapter to give one matrix. This matches "The solver calls only the three-argument getNearbyDistance()".
  • minimumSubListSize: the PR removes the check that rejected minimumSubListSize greater than 1 together with a nearby size maximum. No docs page states that restriction, so nothing is stale.
  • Value ranges on entities: the PR changes the reachability check for change moves. No docs page describes nearby reachability with value ranges on entities.
  • Public surface: all other changed code is internal Enterprise nearby and partitioned code. It is not under api/** and no docs page names it.

🤖 Generated with Claude Code


Generated by Solver Docs Drift with Claude. The group is already merged, so this pull request fixes main. It is updated when more pull requests on the same branch merge.

TimefoldAI/timefold-solver-enterprise#974 ranks list change and sub-list
change candidates by the trip from the neighbor value to the moved item,
instead of the trip from the moved item to the neighbor.
@timefold-automations
timefold-automations Bot requested a review from a team December 4, 2026 15:06
@timefold-automations timefold-automations Bot added the component/docs Improvements or additions to documentation label Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants