networks[contract] - contracts edges in a graph
|
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
|
|
•
|
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.
>
|
|
>
|
|
>
|
|
| (1) |
>
|
map(proc(e,G) [ e, ends(e,G) ] end proc, edges(G), G);
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
map(proc(e,G) [ e, ends(e,G) ] end proc, edges(G), G);
|
| (5) |
|
|
Download Help Document
Was this information helpful?