File: get.edge.ids.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 (69 lines) | stat: -rw-r--r-- 2,564 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/interface.R
\name{get.edge.ids}
\alias{get.edge.ids}
\title{Find the edge ids based on the incident vertices of the edges}
\usage{
get.edge.ids(graph, vp, directed = TRUE, error = FALSE, multi = FALSE)
}
\arguments{
\item{graph}{The input graph.}

\item{vp}{The indicent vertices, given as vertex ids or symbolic vertex
names. They are interpreted pairwise, i.e. the first and second are used for
the first edge, the third and fourth for the second, etc.}

\item{directed}{Logical scalar, whether to consider edge directions in
directed graphs. This argument is ignored for undirected graphs.}

\item{error}{Logical scalar, whether to report an error if an edge is not
found in the graph. If \code{FALSE}, then no error is reported, and zero is
returned for the non-existant edge(s).}

\item{multi}{Logical scalar, whether to handle multiple edges properly. If
\code{FALSE}, and a pair of vertices are given twice (or more), then always
the same edge id is reported back for them. If \code{TRUE}, then the edge
ids of multiple edges are correctly reported.}
}
\value{
A numeric vector of edge ids, one for each pair of input vertices.
If there is no edge in the input graph for a given pair of vertices, then
zero is reported. (If the \code{error} argument is \code{FALSE}.)
}
\description{
Find the edges in an igraph graph that have the specified end points. This
function handles multi-graph (graphs with multiple edges) and can consider
or ignore the edge directions in directed graphs.
}
\details{
igraph vertex ids are natural numbers, starting from one, up to the number
of vertices in the graph. Similarly, edges are also numbered from one, up to
the number of edges.

This function allows finding the edges of the graph, via their incident
vertices.
}
\examples{
g <- make_ring(10)
ei <- get.edge.ids(g, c(1,2, 4,5))
E(g)[ei]

## non-existant edge
get.edge.ids(g, c(2,1, 1,4, 5,4))
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\seealso{
Other structural queries: \code{\link{[.igraph}};
  \code{\link{[[.igraph}}; \code{\link{adjacent_vertices}};
  \code{\link{are.connected}}, \code{\link{are_adjacent}};
  \code{\link{ecount}}, \code{\link{gsize}};
  \code{\link{ends}}, \code{\link{get.edge}},
  \code{\link{get.edges}}; \code{\link{gorder}},
  \code{\link{vcount}}; \code{\link{head_of}};
  \code{\link{incident_edges}}; \code{\link{incident}};
  \code{\link{is.directed}}, \code{\link{is_directed}};
  \code{\link{neighbors}}; \code{\link{tail_of}}
}