GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

GraphTheory

  

NumberOfEdges

  

NumberOfVertices

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

NumberOfEdges(G,opts)

NumberOfVertices(G)

Parameters

G

-

a graph

opts

-

zero or 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 unweighted 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