GraphTheory[Contract]
|
Calling Sequence
|
|
Contract(G, e, mul)
|
|
Parameters
|
|
G
|
-
|
graph
|
e
|
-
|
edge of the graph
|
mul
|
-
|
equation of the form multi=true or false (optional)
|
|
|
|
|
Description
|
|
•
|
The Contract command contracts the specified edge of a graph. By default, all the loops and multiple edges are removed. By setting multi=true, the loops and multiple edges are preserved and the output is a weighted graph.
|
•
|
To contract multiple edges in a graph, use the foldl command.
|
|
|
Examples
|
|
>
|
|
>
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
Contract the five edges connecting the inner star to the outer pentagon to show K5.
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
|
|
Download Help Document
Was this information helpful?