Priority queus and MST