compGdist {GOstats} | R Documentation

## A function to compute the distance between pairs of nodes in a graph.

### Description

Given a graph, `g`, and a set of nodes in the graph, `whNodes`, Dijkstra's shortest path algorithm is used to compute the distance between all pairs of nodes in `whNodes`.

### Usage

    compGdist(g, whNodes, verbose = FALSE)

### Arguments

`g` | An instance of the `graph` class.
`whNodes` | A vector of lables of the nodes in `g` for which distances are to be computed.
`verbose` | If `TRUE` then output reporting the progress will be reported.

### Details

This function can be quite slow, computation of the pairwise distances is not especially fast and if `whNodes` is long then there are many of them to compute.

### Value

A matrix containing the pairwise distances. It might be worth making this an instance of the `dist` class at some point.

### Author(s)

R. Gentleman

### See Also

`compCorrGraph`

### Examples

     example(compCorrGraph)
     compGdist(corrG, nodes(corrG)[1:5])

[Package GOstats version 2.2.6 Index]