impl a priori collision detection algorithm