Trans-dichotomous algorithms for minimum spanning trees and shortest paths