An Algorithm for the Machine Calculation of Minimal Paths