What are the pros and cons of using built-in Graph/GraphPlot (and related) types vs. types in the Combinatorica package?
You should always use the built-in
Graph unless there is a specific reason to use Combinatorica instead.
Valid reasons to use Combinatorica could be:
- Working with very old code, originally written for Combinatorica
- The need for an algorithm that is neither available as a built-in, nor in any supported package. (There are still a few of these, e.g.
ListGraphs). Update: The IGraph/M package now provides replacements for many of such Combinatorica functions. As for
ListGraphs, I suggest using the
gengtool from the Nauty suite. It's output format, Graph6, can be read directly by Mathematica.
- You are learning about graph theory and combinatorics from the Combinatorica Book
Problems when using Combinatorica:
- Not supported anymore. There will be inconvenient conflicts with built-in symbols. See here for how to make this less painful. Minor compatibility problems with recent Mathematica versions could happen.
- The documentation is lacking. The expectation is that you would buy the Combinatorica Book.
- Performance is not great. All functions are implemented purely in Mathematica. (On the upside: you can read the source code, and the algorithms/implementations are explained in the Combinatorica Book.) Because of this is not suitable for "network science" type applications. It is meant for (mathematical) graph theory.
Here's the guide on replacing Combinatorica with builtin functionality:
GraphUtilities` package contains the
ToCombinatoricaGraph function which can convert a built-in
Graph expression to a
Combinatorica`Graph, in case you need some algorithms from Combinatorica.
GraphPlot, it is purely for visualization, and almost all of its functionality is already built into
I guess it also depends on your data. In my work, I do use the Laplacian for my research which can be, in principle, related to the adjacency matrix. In order to "visualize" my network I use the following:
Since I don't want to do an additional transformation
Laplacian -> Adjacency Matrix (it takes time), I never use
Graph as well as
Combinatorica` for such stuff.