GraphTheory[AddEdge]
|
Calling Sequence
|
|
AddEdge(G, E)
AddEdge(G, E, ip)
|
|
Parameters
|
|
G
|
-
|
undirected graph
|
E
|
-
|
edge, trail or set of edges
|
ip
|
-
|
equation of the form inplace=true or false (optional)
|
|
|
|
|
Description
|
|
•
|
The AddEdge command adds one or more edges to an undirected graph. By default, the original graph is changed to a graph containing the specified set of edge(s). By setting inplace=false the original graph remains unchanged and a new graph containing the specified set of edges is created.
|
•
|
If the graph is weighted, then a weighted edge can be added by calling AddEdge with one or more edges in the form , where the edge is just the set of two vertices, and the weight represents the value of the edge weight.
|
|
|
Examples
|
|
>
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
>
|
|
| (10) |
>
|
|
| (11) |
>
|
|
| (12) |
|
|
Download Help Document
Was this information helpful?