An algorithm for the detection and construction of Monge sequences