I am still looking for answers to this. Is there any documented way at all to remove the EdgeWeight
property from a Graph
? This is such a basic task that there surely must be a way.
Furthermore, yet another property handling bug:
g = Graph[{1 <-> 2, 2 <-> 3}, EdgeWeight -> {5, 6}];
g2 = RemoveProperty[{g, 1 <-> 2}, EdgeWeight];
This corrupts the internal state of the graph, and makes it unusable with several functions:
In[83]:= InputForm[g2]
Out[83]//InputForm=
Graph[{1, 2, 3}, {UndirectedEdge[1, 2], UndirectedEdge[2, 3]}, {EdgeWeight -> {6}}]
As you can see, the EdgeWeight
vector has the wrong length.
Now WeightedAdjacencyMatrix[g2]
or EdgeBetweennessCentrality[g2]
simply stay unevaluated, even though GraphQ[g2]
and WeightedGraphQ[g2]
both return True
.
People have been complaining about property bugs similar to this for years. I keep wondering if we should consider the Graph
-functionality of Mathematica abandoned, and no longer developed.
There are even functions which have been broken since their introduction 3 years ago and are still broken in 11.1.0 despite multiple reports.