File: all_simple_paths.Rd

package info (click to toggle)
r-cran-igraph 1.0.1-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 18,232 kB
  • sloc: ansic: 173,538; cpp: 19,365; fortran: 4,550; yacc: 1,164; tcl: 931; lex: 484; makefile: 149; sh: 9
file content (47 lines) | stat: -rw-r--r-- 1,547 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/paths.R
\name{all_simple_paths}
\alias{all_simple_paths}
\title{List all simple paths from one source}
\usage{
all_simple_paths(graph, from, to = V(graph), mode = c("out", "in", "all",
  "total"))
}
\arguments{
\item{graph}{The input graph.}

\item{from}{The source vertex.}

\item{to}{The target vertex of vertices. Defaults to all vertices.}

\item{mode}{Character constant, gives whether the shortest paths to or
from the given vertices should be calculated for directed graphs. If
\code{out} then the shortest paths \emph{from} the vertex, if \code{in}
then \emph{to} it will be considered. If \code{all}, the default, then
the corresponding undirected graph will be used, ie. not directed paths
are searched. This argument is ignored for undirected graphs.}
}
\value{
A list of integer vectors, each integer vector is a path from
  the source vertex to one of the target vertices. A path is given by its
  vertex ids.
}
\description{
This function lists are simple paths from one source vertex to another
vertex or vertices. A path is simple if the vertices it visits are not
visited more than once.
}
\details{
Note that potentially there are exponentially many paths between two
vertices of a graph, and you may run out of memory when using this
function, if your graph is lattice-like.

This function currently ignored multiple and loop edges.
}
\examples{
g <- make_ring(10)
all_simple_paths(g, 1, 5)
all_simple_paths(g, 1, c(3,5))
}
\keyword{graphs}