I am trying to make a function to calculate whether a given supply of reagents is sufficient to create a list of products at a given solution.
So for a list of products $$ (a_1, b_1), (a_2, b_2) ... (a_n, b_n) $$ where $a_n$ = concentration of solution (mol/L)
and $b_n$ = volume of solution (L)
and a list of supplies of the same format (concentration, volume)
How can I mathematically determine whether or not the supplies are sufficient to meet the demand, assuming I have infinite water to perform dilutions? Essentially, I'm trying to determine if I can create the "products" through any combination of dilutions of the finite and available supplies.
Dilution: If I have 500 L of a 2 mol/L solution, I can add 500 L of water to create 1000 L of a 1 mol/L solution. Thus, even a small amount of a very concentrated supply may satisfy many products.
Assumptions: Assume that for this situation, there is only one chemical at issue, and any "supply" can be used to satisfy any "product" . Heuristic solutions are usable if the % error is small (~ 5%). A product may also use many supplies, so long as the total volume of supply used is less than b. These lists are finite, but may contain thousands of items.
Attempts: I can think of a recursive way to perform this calculation, but it is computatioanlly expensive for a number of reasons related to the way this data is stored.