graphModification: Graph Modification

Description Usage Arguments Value Functions Examples

Description

shortestpath provides various graph modification functions that are used internally.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
setInfiniteMinDists(graph, overwrite = TRUE)

setRandomVertexCoordinates(graph, overwrite = TRUE)

setVertexCoordinatesFromLayout(graph, layout = nicely(), overwrite = TRUE)

setEuclideanEdgeWeights(graph, overwrite = TRUE)

setRandomEdgeWeights(graph, dist.fun = function(n) ceiling(runif(n, 0, 10)),
  overwrite = TRUE)

setUniformEdgeWeights(graph, overwrite = TRUE)

setEmptyShortestPathPredecessors(graph, overwrite = TRUE)

setRoute(graph, from, to)

setVertexSets(graph, val = NA, overwrite = TRUE)

setAlphabeticalVertexNames(graph, overwrite = TRUE)

permuteGraph(graph)

Arguments

graph

The original graph object. Will not be modified.

overwrite

If FALSE, graphs with an existing attribute will not be updated.

layout

An igraph layout function. See igraph::layout.

dist.fun

A function that accepts the required vector length as an argument and returns a vector of weights of the given length.

from

The graph's source vertex for single-source algorithms. For all-shortest-paths algorithms, FALSE should be passed.

to

The graph's target vertex for single-source algorithms. For all-shortest-paths algorithms, FALSE should be passed.

val

the default vertex set value.

Value

The updated graph object.

Functions

Examples

1
2
3
4
5
6
7
8
library(igraph)

g <- random.graph.game(10, 0.5) %>%
  setAlphabeticalVertexNames %>%
  setRandomEdgeWeights()

plot(g)
E(g)$weight

huoston/shortestpath documentation built on May 25, 2019, 8:18 a.m.