Algorithm for Determining the Sum Formula of Metabolites from Mass Spectrometry Spectra (Foundations of Computing and Decision Sciences, 2025)