Skip to content

Subgraph ​

The induced subgraph of g on the given vertices.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageSubgraph✓
Subgraph(g, vertices)those vertices (in gg's order), and every edge of gg with both endpoints among them.
Typed signatures
TypePackageApplies
(value, list<any>) -> valuecombinatoricsalways

Domain: Collections

Examples

Basic #

The induced subgraph on 3 of K4K_4's vertices is K3K_3

live ↗
InSubgraph(CompleteGraph(4),[1,2,3])\mathrm{Subgraph}(\mathrm{CompleteGraph}(4), \bigl\lbrack1, 2, 3\bigr\rbrack)OutGraph([1,2,3],[UndirectedEdge(1,2),UndirectedEdge(1,3),UndirectedEdge(2,3)])\mathrm{Graph}(\bigl\lbrack1, 2, 3\bigr\rbrack, \bigl\lbrack\mathrm{UndirectedEdge}(1, 2), \mathrm{UndirectedEdge}(1, 3), \mathrm{UndirectedEdge}(2, 3)\bigr\rbrack)
About
Examples1
Checked againstWolfram Language 1 agree
CrosswalkWolfram Language

See also: NeighborhoodGraph, Graph