Minimum path cost

Modified function to get minimum path from source to destination