GraphTheory/EdgeMultiplicity - Maple Help

GraphTheory

 EdgeMultiplicity
 return edge multiplicity
 IsMultigraph
 test if graph is multigraph

 Calling Sequence EdgeMultiplicity(G, e) EdgeMultiplicity(G) IsMultigraph(G)

Parameters

 G - graph e - list or set of vertices; edge of graph

Description

 • EdgeMultiplicity(G, e) returns the edge multiplicity of e in G. This a nonnegative integer indicating the number of times the edge e appears in G.
 • EdgeMultiplicity(G) returns the edge multiplicity matrix of G. This a square matrix A where ${A}_{i,j}$ is the number of edges from vertex i to vertex j in the graph G.
 • IsMultigraph(G) returns true if G is a multigraph.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{G1}≔\mathrm{Graph}\left(5,\mathrm{Trail}\left(1,2,3,4,3\right)\right)$
 ${\mathrm{G1}}{≔}{\mathrm{Graph 1: an undirected multigraph with 5 vertices and 4 edge\left(s\right)}}$ (1)
 > $\mathrm{EdgeMultiplicity}\left(\mathrm{G1},\left\{3,4\right\}\right)$
 ${2}$ (2)
 > $\mathrm{IsMultigraph}\left(\mathrm{G1}\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{G2}≔\mathrm{Graph}\left(5,\left\{\left\{1,2\right\},\left\{2,3\right\},\left\{2,4\right\},\left\{3,5\right\}\right\}\right)$
 ${\mathrm{G2}}{≔}{\mathrm{Graph 2: an undirected graph with 5 vertices and 4 edge\left(s\right)}}$ (4)
 > $\mathrm{EdgeMultiplicity}\left(\mathrm{G2},\left\{1,2\right\}\right)$
 ${1}$ (5)
 > $\mathrm{IsMultigraph}\left(\mathrm{G2}\right)$
 ${\mathrm{false}}$ (6)

Compatibility

 • The GraphTheory[EdgeMultiplicity] and GraphTheory[IsMultigraph] commands were introduced in Maple 2023.