[Add] Sorting routine for mst

Signed-off-by: Oleg Komarov <o.komarov11@imperial.ac.uk>