add function to select algorithm based on user input
remove debug prints and add printing of cost for weighted graphs