With p being the number of atoms in the molecular formula without the hydrogens, an empty matrix A is built. This matrix is filled in descending order starting with the maximal 𝑝 𝑥 𝑝 capacities (e.g. 3 for a carbon atom), decrementing its valence (e.g. 4 for the same carbon atom), and this is performed for each atom. Due to the diagonal symmetry of such matrices, only the upper triangular part needs to be filled. A canonical test, as described below, is performed once a block is filled. In a matrix, a block is defined as a number of rows and their transposes (i.e. columns). For example, a block between two indices 1 and 4 means the first algorithm then modifies the same input matrix A until there are no more possible changes. This is called the "build-and-forget method" . The overall algorithm structure is explained in Algorithm 1 . first, then the valences of each oxygen atom, and lastly the valences of all 6 hydrogen atoms. To optimize the process, the hydrogens are avoided in the further construction of the matrices, i.e the hydrogen distribution step. Thus, the initial partition is and the λ = {6, 2} corresponding matrix is a matrix (built on 6 carbons and 2 oxygens). 8 𝑥 8