dot-couples_replace: Replacement matching: each left picks its best right...

.couples_replaceR Documentation

Replacement matching: each left picks its best right independently

Description

The compiled design gives every column capacity for every row, so the rows never compete and the optimum of the whole network is each row's own cheapest columns. plan$per_row is how many of them a row takes: the requested ratio, or the column count when there are fewer columns than that. A lazy cost spec is answered one row at a time in C++, through the same row search the implicit loop seeds with, so no row of costs is ever held in R.

Usage

.couples_replace(
  cost_matrix,
  left,
  right,
  left_ids,
  right_ids,
  vars,
  ratio = 1L,
  plan
)

Value

List with pairs tibble, unmatched list, and info list.


couplr documentation built on Sept. 17, 2026, 1:08 a.m.