shortPath {gRapHD} | R Documentation |
Shortest paths between one vertex and all other vertices.
shortPath(model=NULL,edges=NULL,v=NULL,p=NULL)
model |
gRapHD object. |
edges |
matrix with 2 columns, each row representing one edge, and each column one of the vertices in the edge. Column 1 contains the vertex with lower index. |
v |
vertex. |
p |
number of vertices. If NULL , the number of vertices will
be considered as equal the maximum vertices' index, i.e.,
p=max(edges) . |
Calculates the shortest path between the vertex v
and all other
vertices.
vector |
with length equal p , with the shortest path length from
v to each other vertex. |
Gabriel Coelho Goncalves de Abreu (Gabriel.Abreu@agrsci.dk)
Rodrigo Labouriau (Rodrigo.Labouriau@agrsci.dk)
David Edwards (David.Edwards@agrsci.dk)
data(dsCont) m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR") shortPath(edges=m1$edges,v=1)