Skip to contents

Shortest Path Related Functions

Usage

distances(
  graph,
  from = integer(0L),
  to = from,
  weights = numeric(0L),
  mode = 3L,
  algorithm = c("dijkstra", "bellman-ford", "johnson")
)

get_shortest_paths(
  graph,
  from,
  to = integer(0L),
  weights = numeric(0L),
  mode = 3L
)

get_all_shortest_paths(
  graph,
  from,
  to = integer(0L),
  weights = numeric(0L),
  mode = 3L
)

get_all_simple_paths(graph, from, to = integer(0L), cutoff = -1L, mode = 3L)

average_path_length(
  graph,
  weights = numeric(0L),
  directed = FALSE,
  unconn = TRUE
)

path_length_hist(graph, directed = FALSE)

Arguments

graph

igraph_ptr object.

from

Vertices of interest.

to

Vertices of interest.

weights

Numeric edge weights; TRUE to use Eattr(graph, "weight").

mode

Edge type to count; {1: OUT, 2: IN, 3: ALL}.

algorithm

character

cutoff

integer

directed

Boolean, whether to consider directed paths. Ignored for undirected graphs.

unconn

logical