optimizing topology spec map structure