We use a two-stage approach to characterize dissimilarity between fentanyl analogs using high-resolution ESI-MS/MS measurements. We first consider the absolute difference between their precursor m/z values, Δ %&! = |𝑀 ! -𝑀 " |, where 𝑀 ' is the precursor m/z of analogs 1 and 2, respectively. If Δ %&! > 𝜖 ($ = 0.005, we set the dissimilarity between the analogs as 1 (i.e., the maximum possible dissimilarity). If Δ %&! ≤ 𝜖 ($ = 0.005, and the two analogs have at least one pair of MS 2 mass spectra that were collected at the same collision energy, we compute dissimilarity as