I was wondering how civil engineers plan roads embedded in rugged terrain (e.g. over a mountain). How do you find an optimal route (length, allowable gradient, minimal amount of earth moved,...) Is there any software for this or is it done 'by hand'?