rigraph icon indicating copy to clipboard operation
rigraph copied to clipboard

Convert edgepaths from shortest.paths function to edgelist

Open abhik1368 opened this issue 9 years ago • 1 comments

I am trying to first get the shortest paths then convert the paths to edgelist . Is there any function to convert the edge paths(epath) to edgelist in igraph ?

abhik1368 avatar Oct 03 '16 22:10 abhik1368

Are you using the "shortest_paths" function? You can specify the output as vpath, epath, or both:

shortest_paths(g, from = 1, to = 4, output = "both")

from the documentation for "output" in shortest_paths:

Character scalar, defines how to report the shortest paths. “vpath” means that the vertices along the paths are reported, this form was used prior to igraph version 0.6. “epath” means that the edges along the paths are reported. “both” means that both forms are returned, in a named list with components “vpath” and “epath”.

rtrigg avatar Dec 19 '16 05:12 rtrigg

Closed as this is a support question, not a genuine issue.

ntamas avatar Nov 02 '22 10:11 ntamas