gate location optimization