NumberOfEdges - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

NumberOfEdges

  

count number of edges in graph

  

NumberOfVertices

  

count number of vertices in graph

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

NumberOfEdges(G,opts)

NumberOfVertices(G)

Parameters

G

-

a graph

opts

-

one or more options as specified below

Options

• 

selfloops=truefalse

  

Specifies whether self-loops should be included in the count of edges returned. The default value is true.

Description

• 

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.

Examples

withGraphTheory:

K4CompleteGraph4

K4Graph 1: an undirected graph with 4 vertices and 6 edge(s)

(1)

NumberOfVerticesK4

4

(2)

NumberOfEdgesK4

6

(3)

HDigraphTrail1,2,3,1,4,3,Trail4,2,1,3:

NumberOfVerticesH

4

(4)

NumberOfEdgesH

8

(5)

Compatibility

• 

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