Warning! I posted the question when Mathematica v 8.0 was the coolest kid. The bug has been solved as of version 9.0.1
The help for EdgeLabels
states:
However:
CompleteGraph[4,
EdgeWeight -> Range@6,
VertexShapeFunction -> "Name",
EdgeLabels -> "EdgeWeight"]
Results in:
So, no Edge Labels ... I guess it is a bug.
I used a nasty construct like:
adj = {{\[Infinity], 1, 1, 1, 1}, {1, \[Infinity], 2, 2, 2},
{1, 2, \[Infinity], 2, 2}, {1, 2, 2, \[Infinity], 2},
{1, 2, 2, 2, \[Infinity]}};
WeightedAdjacencyGraph[adj,
VertexShapeFunction -> "Name",
EdgeLabels ->
MapThread[Rule,{EdgeList@#,AbsoluteOptions[#, EdgeWeight]/.{_ -> x_}-> x}],
GraphHighlight -> FindEdgeCover[#]]
&@ WeightedAdjacencyGraph[adj]
Better ideas?
Graph
unfortunately still has some serious problems, be cautious and verify verify verify ...Graph[]
objects occasionally end up in a corrupted state causing some functions to either give a wrong result or crash. I've encountered problems with removing vertices and isomorphism testing in particular. – CathrinecathrynEdgeWeights
rather thanEdgeLabels
. (You may have already realized that. YourMapThread
essentially generates weights on-the-fly.) – Hallucination