Skip to contents

Incident edges of a vertex in a graph

Usage

incident(
  graph,
  vertex,
  ...,
  mode = c("all", "out", "in", "total"),
  v = deprecated()
)

Arguments

graph

The input graph.

vertex

The vertex of which the incident edges are queried.

...

These dots are for future extensions and must be empty.

mode

Whether to query outgoing (‘out’), incoming (‘in’) edges, or both types (‘all’). This is ignored for undirected graphs.

v

[Deprecated] Use vertex instead.

Value

An edge sequence containing the incident edges of the input vertex.

incident(), is_directed(), ecount(), edges(), vcount(), get_eids()

Examples

g <- make_graph("Zachary")
incident(g, 1)
#> ── <edge sequence> 16/78 · from e858276 ────────────────────────────────────────
#>  [1] 1 ─ 2   1 ─ 3   1 ─ 4   1 ─ 5   1 ─ 6   1 ─ 7   1 ─ 8   1 ─ 9   1 ─ 11 
#> [10] 1 ─ 12  1 ─ 13  1 ─ 14  1 ─ 18  1 ─ 20  1 ─ 22  1 ─ 32 
incident(g, 34)
#> ── <edge sequence> 17/78 · from e858276 ────────────────────────────────────────
#>  [1] 9 ─ 34   10 ─ 34  14 ─ 34  15 ─ 34  16 ─ 34  19 ─ 34  20 ─ 34  21 ─ 34 
#>  [9] 23 ─ 34  24 ─ 34  27 ─ 34  28 ─ 34  29 ─ 34  30 ─ 34  31 ─ 34  32 ─ 34 
#> [17] 33 ─ 34