Algorithm for compound fractions
I have a set of N chemical compounds enumerated 1, 2,…, N. For each compound, I have the fraction of each of its constituents, “A”, “B”, and so on. Compounds can also contain other compounds, in which case the corresponding fraction is given. For instance, for N = 5, a sample set is