Optimization techniques for skeletons on grids