5

What is the purpose of a graph that is "undirected, with cost and reverse cost"? Where is the difference to a graph that is "undirected, with cost" ?

For me it does not really make sense, because for my understanding the reverse cost should just come into play when the graph is directed ... (Figure from http://docs.pgrouting.org/dev/doc/src/developer/sampledata.html#fig2) graph that is undirected, with cost and reverse cost

2 Answers 2

4

Maybe the documentation at http://docs.pgrouting.org/dev/src/dijkstra/doc/index.html#pgr-dijkstra can shed some light onto the isse. It would seem like - in an undirected graph - one can go in either direction with either cost or reverse_cost:

enter image description here

Not sure which real-world application this is used for though.

1
  • 1
    Not tried this myself, but this answer suggests a couple of practical applications for this and gives an example. Commented Dec 8, 2015 at 23:48
3

The reason why you can set undirected graph with reverse_cost has a simple reason: the function has two arguments, one for directed true/false and one for reverse_cost true/false. But you're right that it only makes sense for a directed graph. In the other case it will be ignored.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.