paths output from search algorithms?

Hi,

is there a way to get the actual paths itself - instead of the distance -
from the search algorithms like e.g. dijkstra_search?

As a related question, in a weighted adjacency matrix, how are the weights
interpreted for dijkstra and centrality functions (pagerank, betweenness
centrality) that rely on it. Is it low weight = easier to "travel", or is
it the other way around?

Thanks in advance!
Matthias

attachment.html (502 Bytes)

Hi,

is there a way to get the actual paths itself - instead of the
distance - from the search algorithms like e.g. dijkstra_search?

You can use the shortest_path() function.

    http://projects.skewed.de/graph-tool/doc/topology.html#graph_tool.topology.shortest_path

Otherwise you can write your own search visitor which records the path
for you.

As a related question, in a weighted adjacency matrix, how are the
weights interpreted for dijkstra and centrality functions (pagerank,
betweenness centrality) that rely on it. Is it low weight = easier to
"travel", or is it the other way around?

The weights are always _minimized_, unless otherwise stated. Note that
in Pagerank the weights are used differently, since there is no shortest
path computation in this case (see its documentation for more details).

Cheers,
Tiago

Thank you Tiago!

attachment.html (1.79 KB)