WeightedAdjacencyMatrix
The vertex-by-vertex matrix of edge weights of a weighted Graph, 0 where no edge exists.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
WeightedAdjacencyMatrix!WeightedAdjacencyMatrix(g)entry is the weight of the edge from vertex to vertex (both directions, for an undirected edge) — 1, AdjacencyMatrix's own default, when carries no EdgeWeight at all.Typed signatures
| Type | Package | Applies |
|---|---|---|
(value) -> list<list<number>> | combinatorics | always |
Details
- carries its weights via
EdgeWeight -> {w1, w2, …}, one weight per edge in EdgeList order, given as a Graph(edges, EdgeWeight -> {…}) option — see Graph's own note. The Property/PropertyValue per-edge form is not supported. - A multi-edge (two edges between the same ordered pair) sums its parallel edges' weights, matching how AdjacencyMatrix sums parallel edges' counts.
- Returned as a plain matrix (a list of lists) rather than Wolfram's default
SparseArray— the same simplification AdjacencyMatrix documents, for the same reason.
Examples
1 more kept as data, checked against the oraclesAbout
| Examples | 2 |
|---|---|
| Checked against | Wolfram Language 2 differ |
| Crosswalk | Wolfram Language |
See also: AdjacencyMatrix, Graph, GraphDistance