Group Abstract Group Abstract

Message Boards Message Boards

7
|
5K Views
|
3 Replies
|
11 Total Likes
View groups...
Share
Share this post:

[FEATURE] Remove edge weights (or other builtin property) from a graph

Posted 8 years ago
POSTED BY: Szabolcs Horvát
3 Replies
POSTED BY: Vitaliy Kaurov
POSTED BY: Szabolcs Horvát

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.

POSTED BY: Szabolcs Horvát
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard