IncidentEdges - Maple Help

GraphTheory

 IncidentEdges
 find graph edges incident on a vertex

 Calling Sequence IncidentEdges(G, V, d)

Parameters

 G - graph or digraph V - vertex or list of vertices d - (optional) equation of the form direction=incoming or outgoing

Description

 • IncidentEdges returns the set of edges (arcs) which are incident to a given vertices.  If G is a directed graph, then the set of arcs which have a tail in the given list of vertices are returned.
 • IncidentEdges(G, V, direction=incoming) returns the set of arcs which have a head in the given set of vertices.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{CycleGraph}\left(7\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 7 vertices and 7 edge\left(s\right)}}$ (1)
 > $\mathrm{IncidentEdges}\left(G,1\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{7}\right\}\right\}$ (2)
 > $\mathrm{IncidentEdges}\left(G,\left[1,5,7\right]\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{7}\right\}{,}\left\{{4}{,}{5}\right\}{,}\left\{{5}{,}{6}\right\}{,}\left\{{6}{,}{7}\right\}\right\}$ (3)
 > $\mathrm{DG}≔\mathrm{Digraph}\left(\mathrm{Trail}\left(1,2,3,4,5,3\right),\mathrm{Trail}\left(1,5,2,4,1\right)\right)$
 ${\mathrm{DG}}{≔}{\mathrm{Graph 2: a directed unweighted graph with 5 vertices and 9 arc\left(s\right)}}$ (4)
 > $\mathrm{IncidentEdges}\left(\mathrm{DG},\left[2,3\right]\right)$
 $\left\{\left[{2}{,}{3}\right]{,}\left[{2}{,}{4}\right]{,}\left[{3}{,}{4}\right]\right\}$ (5)
 > $\mathrm{IncidentEdges}\left(\mathrm{DG},\left[2,3\right],\mathrm{direction}=\mathrm{incoming}\right)$
 $\left\{\left[{1}{,}{2}\right]{,}\left[{2}{,}{3}\right]{,}\left[{5}{,}{2}\right]{,}\left[{5}{,}{3}\right]\right\}$ (6)