GraphTheory[MakeWeighted]
|
Calling Sequence
|
|
MakeWeighted(G)
MakeWeighted(G, M)
|
|
Parameters
|
|
G
|
-
|
unweighted graph
|
M
|
-
|
(optional) Matrix
|
|
|
|
|
Description
|
|
•
|
The MakeWeighted command returns a graph with vertices and edges from G. If M is part of the input, then the edge weights are taken from it; otherwise edge weights are assumed to be 1. If G is undirected, then M is assumed to be a symmetric matrix.
|
•
|
For efficiency, use datatype=integer for wordsize integer weights and datatype=float[8] for numerical (decimal) edge weights.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
|
|
Download Help Document
Was this information helpful?