K-Means-Type Algorithms: A Generalized Convergence Theorem and Characterization of Local Optimality | Synapse