I am trying to figure out a suitable representation for given set of chemical reactions, which happen over an exhaustive set of chemicals.
The chemicals are $A, B, C, D, E$ and the reactions are given below $$A + A \rightarrow B$$ $$B + C \rightarrow D$$ $$B + D \rightarrow E$$ $$C + E \rightarrow D$$ $$E + E \rightarrow A$$
It's only obvious to form a matrix representaion of the reactions. \begin{array}{X} & A & B & C & D & E \\ A & B & * & * & * & * \\ B & - & * & D & E & * \\ C & - & - & * & * & D \\ D & - & - & - & * & * \\ E & - & - & - & - & A \\ \end{array} where $*$ means no product forms
I tried to label elements with unique integer IDs, so that the product (if any) can be treated as the weight of the edge, but I failed to incorporate this new property into a visualisation of the matrix.
Can any one tell me what form of graphs can be used to represent such data, where combinaiton of two nodes gives rise to another?
For a matrix representation, you example seems to most naturally work as a 3D matrix, with the dimensions representing the first reactant, second reactant and product, and the value representing the yield, speed or some other property.
An alternative method might be to have a bipartite directed graph, with reactants/products in one part and the reactions themselves as nodes in the other part:
This might also work well as a 2D matrix, using a sentinel value of some sort to denote inputs and a yield or other value for the outputs.