A fast algorithm for incremental distance calculation | Synapse