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

Online Help

All Products    Maple    MapleSim


GraphTheory

  

Subgraph

  

construct subgraph of graph

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Subgraph(G, E, opts)

Parameters

G

-

graph

E

-

set or list of edges

opts

-

(optional) one or more options as given below

Options

• 

removesingletons=truefalse

  

Specifies whether vertices with no neighbors in the constructed subgraph should be removed from the vertex list. The default value, false, leaves the vertex list exactly as it was given in G.

Description

• 

The Subgraph command returns the subgraph formed by a specified set (or list) of edges.

• 

To induce a subgraph using a set of vertices, use the InducedSubgraph command.

Examples

withGraphTheory:

K5CompleteGraph5

K5Graph 1: an undirected graph with 5 vertices and 10 edge(s)

(1)

E1,2,1,4,2,3,3,4

E1,2,1,4,2,3,3,4

(2)

HSubgraphK5,E

HGraph 2: an undirected graph with 5 vertices and 4 edge(s)

(3)

evalbEdgesH=E

true

(4)

HighlightSubgraphK5,H

DrawGraphK5

Compatibility

• 

The GraphTheory[Subgraph] command was updated in Maple 2023.

• 

The removesingletons option was introduced in Maple 2023.

• 

For more information on Maple 2023 changes, see Updates in Maple 2023.

See Also

DeleteEdge

HighlightSubgraph

InducedSubgraph