GraphTheory
NumberOfEdges
count number of edges in graph
NumberOfVertices
count number of vertices in graph
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
NumberOfEdges(G,opts)
NumberOfVertices(G)
G
-
a graph
opts
one or more options as specified below
selfloops=truefalse
Specifies whether self-loops should be included in the count of edges returned. The default value is true.
The NumberOfEdges(G,opts) command returns the number of edges (or arcs) in G.
The NumberOfVertices(G) command returns the number of vertices in G.
with⁡GraphTheory:
K4≔CompleteGraph⁡4
K4≔Graph 1: an undirected graph with 4 vertices and 6 edge(s)
NumberOfVertices⁡K4
4
NumberOfEdges⁡K4
6
H≔Digraph⁡Trail⁡1,2,3,1,4,3,Trail⁡4,2,1,3:
NumberOfVertices⁡H
NumberOfEdges⁡H
8
The selfloops option was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
See Also
Digraph
Edges
Graph
Trail
Vertices
Download Help Document