Efficient Path Planning with Soft Homology Constraints