networks(deprecated)/contract - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : networks(deprecated)/contract

networks

  

contract

  

contracts edges in a graph

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

contract(Eset, G)

contract(Pset, G)

Parameters

G

-

graph or network

Eset

-

edge or set or list of edges of G

Pset

-

connected vertex pair or a set or list of connected vertex pairs

Description

• 

Important: The networks package has been deprecated.  Use the superseding command GraphTheory[Contract] instead.

• 

This procedure contracts the edges of G, specified by the first argument.

• 

The edges to be contracted may be specified either individually or as a set of edge names or pairs of ends of edges (for example, {1,3} ).

• 

If pairs of ends are used, each pair must uniquely identify an edge.

• 

This procedure returns as its value the name of the vertex that survived the contraction of the specified edge. If more than one edge is contracted, then a set of surviving names is provided.

• 

This routine is normally loaded by using the command with(networks), but it may also be referenced by using the full name networks[contract](...).

Examples

Important: The networks package has been deprecated.  Use the superseding command GraphTheory[Contract] instead.

withnetworks:

Gcomplete4:

vcontract1,4,G

v1

(1)

map(proc(e,G) [ e, ends(e,G) ] end proc, edges(G), G);

e1,1,2,e2,1,3,e4,2,3,e5,1,2,e6,1,3

(2)

eaddedgev,3,G

ee7

(3)

contractv,3,G

1

(4)

map(proc(e,G) [ e, ends(e,G) ] end proc, edges(G), G);

e1,1,2,e2,1,e4,1,2,e5,1,2,e6,1

(5)

See Also

GraphTheory

GraphTheory[Contract]

networks(deprecated)[connect]

networks(deprecated)[delete]

with