fn barycenter(neighbors: &[usize], positions: &[(usize, usize)]) -> f64
Barycenter: average position of neighbors in the given position map.