GraphTheory
Edges
set of edges of graph
Vertices
list of vertices of graph
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Edges(G,opts)
Vertices(G)
G
-
a graph
opts
(optional) one or more options as specified below
multigraph=truefalse
Specifies whether multiple edges should be included in the edges returned. The default value is true.
selfloops=truefalse
Specifies whether self-loops should be included in the set of edges returned. The default value is true.
weights=truefalse
Specifies whether weights should be included in the output. If true, each element of the resulting set is a list whose first element is the edge, and whose second element is the edge weight. The default value is false.
The Edges(G,opts) function returns a collection of the edges of G.
If G is a multigraph, a list is returned. Otherwise, a set is returned.
The Vertices(G) function returns a list of the vertex labels of G.
To count vertices and edges, use the NumberOfEdges or NumberOfVertices commands.
with⁡GraphTheory:
G≔Graph⁡1,2,3,4,1,2,1,3,1,4
G≔Graph 1: an undirected graph with 4 vertices and 3 edges
Vertices⁡G
1,2,3,4
Edges⁡G
1,2,1,3,1,4
G≔Graph⁡a,b,c,a,b,b,c,c,a
G≔Graph 2: a directed graph with 3 vertices and 3 arcs
a,b,c
a,b,b,c,c,a
A≔Matrix⁡0,1,1,1,0,1,1,1,0:
G≔Graph⁡A
G≔Graph 3: an undirected graph with 3 vertices and 3 edges
1,2,1,3,2,3
A≔Matrix⁡0.,0.5,0.,0.,0.,1.0,1.5,0.,0.:
G≔Graph 4: a directed weighted graph with 3 vertices and 3 arcs
1,2,2,3,3,1
Edges⁡G,weights
1,2,0.5,2,3,1.0,3,1,1.5
The GraphTheory[Edges] and GraphTheory[Vertices] commands were updated in Maple 2020.
The selfloops option was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020 .
The multigraph option was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023 .
See Also
AddEdge
AddVertex
Graph
Neighbors
PermuteVertices
RelabelVertices
SetEdgeWeight
Download Help Document
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル