Skip to contents

Solves a minimum-cost unbounded covering knapsack problem by brute-force enumeration to find vial combinations of denominations that achieve at least target dose with minimum total cost, breaking ties by the smallest number of vials.

Usage

OR.dose.vials(denominations, target, costs = NULL)

Arguments

denominations

Numeric vector of vial sizes.

target

Target total dose.

costs

Optional numeric vector of costs per vial. If NULL, assumed proportional to denominations.

Value

A data frame of optimal combinations with columns:

  • n1, n2, ..., nk: counts per vial denomination

  • sum_n: total number of vials

  • sum_amount: total dose

  • diff_amount: excess over target

  • sum_cost: total cost

See also

Other dose: OR.dose.weights()