Added functionality to retrieve total cost of solution path

- Exposed the total cost of the discovered solution path through a getter function. This will be useful in cases where the total cost is needed for further processing.