If there are ready libraries, modules, or even for finding optimal routes on the map? There is a set of addresses, about 6000 (can be reduced if the break within the same city, it will be up to 500) pieces, you need to break them into groups of 10 pieces and find the most optimal routes. Maybe there's some thread add-on to Postgis? Don't even know which side to approach the problem.
Themselves addresses are not a problem to convert to coordinates.