dijkstra (#16) - start and end edges with Dijkstra (#126) - Message List

start and end edges with Dijkstra

Some problems with including start and end edges into my path using Dijkstra. My graph is not oriented, but with start and end edges it works like these were oriented. Ex. I have 5 edges, 1st -start edge and 5th is the end edge. If the first and the fifth have been drawn in path direction , my path will consist of edges with ids 1,2,3,4,5. If I turn the first one around, I will get 2,3,4,5. If I turn the last one around too, I will get 2,3,4. The directions of the intermediate edges do not matter. If there were only two edges, I would get two, one or none ids depending on the drawing direction of the edges. I am using pgrouting 1.0.1 and tried it with dijkstra_sp and dijkstra_sp_directed (with FALSE for dir).

  • Message #446

    Sorry, but I really didn't understand. What do you mean by "turn the first one around"?

    • Message #447

      Just to flip the line, to draw in opposite direction

      • Message #448

        Do you just switch source and target?

      • Message #449

        I mean - do you change the source and target id for the edge? If you do, it means that you break topology.

        • Message #450

          I just meant, that ... let suppose we have connected edges with id's 1,2,3,4 connected 1->2->3->4 and all of them are drawn from left to right. If the start point is on the edge with id=1 and target on the edge id=4, then I 'll get the right path 1-2-3-4. If i start from the edge id=4 towards the first one(id=1) the path will be 3-2 (I'll miss two edges). If I start from the edge (id=2) towards the id=1, I will get none edge. But from id=1 to id=2, the path is 1-2. If I drive along the first or last edge in the drawing directions, these edges will be included into the path. If in opposite direction then not.

          • Message #455

            It sounds strange. Can you please post here that piece of data you are talking about?