Keep image constrast under controlΒΆ
If your image contains a extra bright spot, crossing that region will become almost forbidden for the algorithm, as there will be a large penalty for doing so. This means that the algorithm will draw too little in the bright region and too much elsewhere, resulting in an image that contains an (almost) empty spot and excessive black outside that part of the image. If you decrease the brightness of that part of the image the algorithm will be able to cross that region, it will just spend less time there - thus correctly reproducing the difference in brightness difference in the image, but with no hard constraints.
You can either preemptively decrease the brightness of bright spots or do so if the result looks too empty in the bright area/too dark outside of it.