GraphTheory
Arrivals
vertices which are tails of arcs inbound to vertex
Departures
vertices which are heads of arcs outbound from vertex
Neighbors
neighbors of vertex
Calling Sequence
Parameters
Description
Examples
Arrivals(G, v)
Departures(G,v)
Neighbors(G, v)
G
-
graph
v
(optional) vertex of the graph
Neighbors returns a list of lists if the input is just a graph. The ith list is the list of neighbors of the ith vertex of the graph. Neighbors(G, v) returns the list of neighbors of vertex v in the graph G.
Arrivals returns a list of the lists of vertices which are at the tail of arcs directed into vertex i. Undirected edges are treated as if they were bidirectional. If a vertex v is specified, the output is only the list of vertices which are at the tail of arcs directed into vertex v.
Departures is similar to Arrivals, but returns a list of the lists of vertices which are at the head of edges directed out of vertex i. If a vertex v is specified, the output is only the list of vertices which are at the head of edge directed out of vertex v.
with⁡GraphTheory:
G≔Digraph⁡Trail⁡1,2,3,4,5,6,4,7,8,2
G≔Graph 1: a directed graph with 8 vertices and 9 arc(s)
DrawGraph⁡G
Neighbors⁡G,4
3,5,6,7
Arrivals⁡G,4
3,6
Departures⁡G,4
5,7
Neighbors⁡G
2,1,3,8,2,4,3,5,6,7,4,6,4,5,4,8,2,7
Arrivals⁡G
,1,8,2,3,6,4,5,4,7
Departures⁡G
2,3,4,5,7,6,4,8,2
See Also
AdjacencyMatrix
Degree
InDegree
OutDegree
Trail
Download Help Document