Hi, I have a optimization problem and I need to find a way to solve it even if only with an approximate solution. Let's suppose we have a finite set of vertical containers each with a distinct liquid chemical inside.(say a handful of vertical pipes). At the top, these containers have an inflow of chemical all at different and varying flow rates. We have sensors to measure the height of the chemical inside each container. At the bottom, they all connect into a single common point with a switching outflow valve that allows the discharge of only one container at any point in time. The optimization comprises the minimization of the cumulative sum of all chemical heights, via the optimal switching times of the outflow valve. Switching has a cost of no flow for X seconds. This seems rather like a common production scheduling problem where one needs to work out the sequence and switching times of the valve in real time based on sensor readings. But there is one additional constraint: - there is a set of future time windows (schedule) during which a particular chemical must be flowing out. The schedule is sparse, say about 90% of the time there is nothing scheduled. One obvious approximation is to approximate the optimal solution by optimizing without the schedule constraints and simply switch to the scheduled chemical when the time comes and hope for the best. This is however, not enough. I suspect there must be more optimal solutions out there. Any ideas or pointers of where I could find solutions to similar problems?