shortPath {gRapHD}R Documentation

Shortest path.

Description

Shortest paths between one vertex and all other vertices.

Usage

  shortPath(model=NULL,edges=NULL,v=NULL,p=NULL)

Arguments

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).

Details

Calculates the shortest path between the vertex v and all other vertices.

Value

vector with length equal p, with the shortest path length from v to each other vertex.

Author(s)

Gabriel Coelho Goncalves de Abreu (Gabriel.Abreu@agrsci.dk)
Rodrigo Labouriau (Rodrigo.Labouriau@agrsci.dk)
David Edwards (David.Edwards@agrsci.dk)

Examples

  data(dsCont)
  m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
  shortPath(edges=m1$edges,v=1)

[Package gRapHD version 0.1.0 Index]