GraphTheory
Subgraph
construct subgraph of graph
Calling Sequence
Parameters
Description
Examples
Subgraph(G, E)
G
-
graph
E
set or list of edges
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.
with⁡GraphTheory:
K5≔CompleteGraph⁡5
K5≔Graph 1: an undirected unweighted graph with 5 vertices and 10 edge(s)
E≔1,2,1,4,2,3,3,4
H≔Subgraph⁡K5,E
H≔Graph 2: an undirected unweighted graph with 4 vertices and 4 edge(s)
evalb⁡Edges⁡H=E
true
HighlightSubgraph⁡K5,H
DrawGraph⁡K5
See Also
DeleteEdge
HighlightSubgraph
InducedSubgraph
Download Help Document
What kind of issue would you like to report? (Optional)