WLJS LogoWLJS Notebook

EdgeContract

EdgeContract[g, e] contracts the edge e of the graph g.

EdgeContract[g, {e1, e2, ...}] contracts a collection of edges e1, e2, ....

EdgeContract[{v -> w, ...}, ...] uses rules v->w to specify the graph g.

Examples

Contract an edge:

EdgeContract[CycleGraph[4], 1 <-> 2]
(* Graph with 3 vertices *)

Contract multiple edges:

EdgeContract[CompleteGraph[4], {1 <-> 2, 3 <-> 4}]
(* Graph with 2 vertices *)

Please visit the official Wolfram Language Reference for more details.

On this page