I encountered a problem trying to change the EdgeWeights in a graph. I am runnning Mathematica 10.1 under Windows 7 Enterprise.
I have an undirected graph with 144 nodes and 576 edges. I first produce a sparce, symmetric adjacency matrix called "waminfful", then use that to define a graph called "myg".
myg = WeightedAdjacencyGraph[
Range[144]
, waminffull
, DirectedEdges -> False
];
Everything seemed to work fine until I tried to change some of the edge weights. I found that some of them would change and others would not.
In the example below, the initial edge weight was 1, and I was able to reset it to 35 without a problem.
PropertyValue[{myg, 52 <-> 53}, EdgeWeight]
PropertyValue[{myg, 52 <-> 53}, EdgeWeight] = 35.0;
PropertyValue[{myg, 52 <-> 53}, EdgeWeight]
1. 35.
However, as the following example shows, this does not always work:
PropertyValue[{myg, 53 <-> 42}, EdgeWeight]
PropertyValue[{myg, 53 <-> 42}, EdgeWeight] = 35.0;
PropertyValue[{myg, 53 <-> 42}, EdgeWeight]
1.41421 1.41421.