Q:

Is there an algorithm that matches constrained input to possible output? 

I'm working on a problem where a user provides a list of input products that can be turned into different end products.  Each input product has a specific set of outputs it could become.  The user also provides a list of expected output products and how much of each they want.  I'm looking to see if there is a known algorithm for matching the various inputs to the outputs to meet the demand with as best of a fit as possible.  
Example:  

Product A can become products X and Y
  Product B can become products Y and Z  
There are 5 A and 7 B.
  Can you make 3 X, 4 Y, and 6 Z? 

I would like an approach that would help me find the output:  
3 A -> X
2 A -> Y
2 B -> Y
5 B -> Z
Missing 1 Z

A:

You can solve this problem by applying any of the max flow algorithms to a flow network constructed as follows:

Add source node S and sink node T
For each input product add node Ai
For each output product add node Zj
For each input product add an edge from S with capacity equal to the number of the corresponding product
For each output product add an edge to T with capacity equal to the desired number of the corresponding product
From each Ai and Zj add an edge with capacity equal to the number of Ai product

Here is how the network would look for your example. 

If the max flow is equal to the total capacity entering T, a solution is defined by min cat; otherwise, a solution is not possible. 
Note: If all you need is a yes/no answer, you could eliminate Ai nodes, and add edges from S to Zj, with capacities equal to the total for this output over all input products (i.e. X=5, Y=12, and Z=7).  This would produce the same decision result, but you wouldn't be able to find out how many input products of each kind need to be consumed in the process.