GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/Neighbors

GraphTheory

  

Arrivals

  

Departures

  

Neighbors

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Arrivals(G, v)

Departures(G,v)

Neighbors(G, v)

Parameters

G

-

graph

v

-

(optional) vertex of the graph

Description

• 

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.

Examples

withGraphTheory:

GDigraphTrail1,2,3,4,5,6,4,7,8,2

GGraph 1: a directed unweighted graph with 8 vertices and 9 arc(s)

(1)

DrawGraphG

NeighborsG,4

3,5,6,7

(2)

ArrivalsG,4

3,6

(3)

DeparturesG,4

5,7

(4)

NeighborsG

2,1,3,8,2,4,3,5,6,7,4,6,4,5,4,8,2,7

(5)

ArrivalsG

,1,8,2,3,6,4,5,4,7

(6)

DeparturesG

2,3,4,5,7,6,4,8,2

(7)

See Also

AdjacencyMatrix

Degree

InDegree

OutDegree

Trail