 # Pooling problem

A type of blending problem, as follows.

Given:
1. A set of sources, indexed by $LaTeX: \textstyle 1,\dots,N_s.$ Each source supplies raw feeds in limited amounts, such as crude oil.
2. A set of attributes, indexed by $LaTeX: \textstyle 1,\dots,N_a.$ Each supply contains one or more attributes. An example of an attribute is the percent of sulfur in a crude oil supply.
3. A set of products, indexed by $LaTeX: \textstyle 1,\dots,N_d,$ for which there is demand; each product has a quality defined by its attributes. For example, if percent sulfur is an attribute, each refined petroleum product has a range of percent sulfur: 1.5% sulfur is a higher quality product than 2.5% percent sulfur.
4. A set of pools, indexed by $LaTeX: \textstyle {1},\dots,N_p.$ Each pool is formed by inflows from sources, whose attributes are linearly mixed to determine the attributes of the pool, and hence its quality. Pools combine to form products (see Flow of Materials below). For example, suppose a pool receives flow values $LaTeX: x$ and $LaTeX: y$ from two sources whose attribute values are $LaTeX: A$ and $LaTeX: B,$ respectively. Then, the pool's attribute value is the average: $LaTeX: \textstyle (Ax+By)/(x+y).$
                            Flow of Materials
~~~~~~~~~~~~~~~~~
Sources          Pools         Products
S(s,p)         P(p,d)
SUPPLY --->(s)------------->(p)------------>(d)--->DEMAND



The objective is to minimize cost, which is the sum of source flow costs, subject to four types of constraints:

1. Limited supplies: $LaTeX: \frac{\sum_{1} S(s,1)}{\mbox{Total flow out of source } s \mbox{ (into pools)}} \le \mbox{SUPPLY}(s)$

2. Balances at pools: $LaTeX: \frac{\sum_s S(s,p)}{\mbox{Total flow into pool (from source)}} - \frac{\sum_d P(p,d)}{\mbox{Total flow out of pool (to products)}} = 0$

3. Quality constraints: $LaTeX: L(p,a) \le Q(p,a) = \frac{\sum_s w(s,a)S(s,p)}{\sum_s S(s,p)} \le U(p,a).$
The numerator is a weighted sum, where the weights (w) are the (given) quality values of attribute a at the sources (s). The denominator is the total flow into the pool (p).

4. Demand requirements: $LaTeX: \frac{\sum_p P(p,d)}{\mbox{Total flow into product (from pools)}} \ge \mbox{DEMAND}(p).$