Order vertices u and v for RMQ.