The commissioner of correction, with the approval of the governor, is authorized to contract with the commissioner of transportation for the use of any or all inmates, except those for which it is undesirable or impracticable in the opinion of those officials, to work outside the walls of the main prison in constructing any new or maintaining any old public road in this state.