Optimization route from device id