Similar Items: Thermodynamic graph-rewriting