I would like to use one of pgrouting's algorithm to find the (shortest) path between 2 points with: (a) predominance for a specific type of road and (b) intemediate points.
To build the data I used the osm2pgrouting. I would like to focus first on the issue (a).
Problem (b) (LESS IMPORTANT) is to determine if the length of searched path is less than for example 10km. If no then path should visit one of specified intermediate point (or points).
I don't think there are algorithms in pgrouting which condider these "stops" (intermediate points between source and target). I think this problem (b) should be solved by searching path from point1 to point2 and then from p2 to p3 etc. etc. but I don't know yet how to determine those points.
Graph theory in general solves shortest path based on edge weights. IE: to get from A to B in the graph it will select those edges that minimize sum of the weights of the edges in the path. So in pgRouting you select the weights as the edge lengths of shortest path length, or can compute the weight as the time to traverse the edge time = length/speed, for shortest time, but for you problem you can make your own weights with an equation like length*preference where preference is some fraction where smaller is more preferred. Obviously you will get back cost based on this factor along with the edge ids and a simple join useing the edge id will get you bcak to the original table. This strategy should work for most any of our algorithms.