WOLFRAM LANGUAGE COMPATIBILITY INFORMATION
As of Version 8, much of the functionality covered by Combinatorica has been implemented in the Wolfram System.
Combinatorica provided a large amount of functionality in fields such as graph theory and permutations. In Version 8, a native Wolfram System implementation of much of this functionality has been created. While there is some overlap in naming, the native implementation is fundamentally different in many ways.
For example, the Graph object in Combinatorica was a regular Mathematica expression that could be directly pulled apart via expression manipulation functions such as Part. The Wolfram System implementation is instead an atomic object, which is modified only via accessor functions. This allows the Wolfram System to transparently attach rendering hints and other information supporting interactive graph manipulation.
Because of these basic differences, loading Combinatorica overrides the new functionality and provides compatibility with the old Graph expressions. It silently shadows the new functions, so that old code may be run. In most cases, the new implementation should not be mixed with use of Combinatorica. If necessary, the two versions can be used simultaneously by the use of full context names, as in or .
See the Graphs & Networks guide for an overview of the Wolfram System functionality.
Graph Representation and Manipulation
Graphs are now input by a list of directed or undirected edges. A display function is not required; like Graphics objects, they render directly in the front end.
Vertex locations are optional.
Directed edges are specified in the edge list.
A graph can be rendered with modified styles to highlight parts. The syntax is not identical, but can be adapted in a straightforward fashion.
Graphs can be input as adjacency matrices.
The adjacency matrix is a sparse array.
At the current time, multigraphs (more than one edge between vertices) are not supported except for the special case of directed graphs, where a single edge in each direction can be specified. A non-symmetric matrix will automatically be understood to be directed; otherwise, use the option DirectedEdges.
For a weighted adjacency matrix, use WeightedAdjacencyGraph. An absent edge is specified by a weight of infinity, not zero.
Note that in the Wolfram System, graph functionality generally refers to the names of vertices, while in Combinatorica, it is the indices or coordinates of the vertices that are used.
Combinatorica's MakeSimple makes the graph undirected; this is a separate operation in the Wolfram System.
Most of the operations to combine graphs are implemented. For some of these, the Wolfram System produces the equivalent simple graph of the corresponding Combinatorica operation. Note particularly that union and sum are defined differently in the Wolfram System. The requirement that the graphs start with the same number of vertices has been removed.
Many of the graph predicates are currently supported via different names, though some use the opposite sense of the predicate, such as WeightedGraphQ.
The Wolfram System also implements functionality for traveling salesman problems, but the syntax is not oriented towards the graph representation; see FindShortestTour.
See also the guide for Paths and Cycles.
The output may also have a different form. For example, FindEulerianCycle returns an edge list, compared to the vertex list returned by EulerianCycle.
|DeBruijnGraph[n, m]||DeBruijnGraph[n, m]|
There are a variety of standard named graphs that are parameterized by values. Most of these from Combinatorica have an equivalent in the Wolfram System. Note that names and syntax may be slightly different. Indexing of the vertices may also vary.
A number of other standard graphs do not take parameters (or in the case of CageGraph, take only a limited range of parameters). These can generally be found in the GraphData database in Version 8.
In some cases, parameterized variants have not yet been implemented in the Wolfram System, but a subset can be found in GraphData. For example, CubeConnectedCycle is defined in GraphData for values 4 through 8; the MycielskiGraph can be found for values 5 through 11.
The Combinatorica function FiniteGraphs returns a list of the non-parameterized named graphs. GraphData could be considered something of an equivalent, as it returns the list of names that GraphData knows. However, this is a significantly longer list than FiniteGraphs!
A small set of the named graphs do not yet have a direct equivalent in the Wolfram System. (See the documentation for TreeGraph for examples of generating random trees; it is still possible, just not yet with the method Combinatorica uses.)