One of the saddest consequences of Steven Wolfram’s descent into megalomaniacal insanity (vis his decision to save science from itself by reinventing it in the image of a popular science book from the 1980s) is the continuing decline of Mathematica, his greatest (and, he seems intent upon forgetting, only) accomplishment.
Why the return to bitter posts? The week of my life I’ll never get back trying to get Mathematica‘s pitifully bad graph theory functions to yield correct results. I never thought I’d see the day when I considered MATLAB a superior product to Mathematica for doing something like network theory, but that day has come. I could go into great detail on the poor design of Mathematica‘s Graph object, but I’ll just leave the reader with the following object lesson on the perils of letting one’s ego interfere with one’s day job:
Another nice bug is the fact that WeightedAdjacencyGraph[WeightedAdjacencyMatrix[g]] often returns an error, despite the obvious fact that it should return the original graph (at least topologically).
Seriously, Wolfram. Are there many more important mathematical topics today than graph theory? You can’t throw a copy of Mathematica these days (and I plan to) without hitting somebody working on a topic for which graph theory plays a central role. The fact that the interface to Graph is an embarassment is nothing compared to the fact that it doesn’t even return correct results when things like GraphDistance are applied to a graph which has been manipulated. When Mathematica starts returning mathematically incorrect results, something is wrong with the world. That thing, I believe, is Stephen Wolfram himself. It’s time for him to move on from Wolfram and let somebody else run the show.
For the few still reading and interested: the bug shown in the picture appears randomly. Most of the time you run that code it yields a plausible, maybe even correct, answer. The oddness of the “road network” graph shown is intentional. The application I was working on was an algorithm to generate a statistical family of road networks. My plan was to create a nearly fully connected (not even planar) graph and then prune the edges which were economically infeasible (didn’t yield a change in the shortest path sufficient justifying their existence relative to some parameter). It was in the process of trying to implement the pruning algorithm that I discovered this bug.)