Firstly we loop throungt all devices, and check if current device is not client. If it is - we continue looping throught them, if it is not - we find latencies for every client and take maximum. Then continue looping. After we have found all maximum latencies, we take minimum value.
So that, we have minimum latency for the worst case of client location.