Since version 10, much of the original functionality in the Combinatorica package has been subsumed (consumed?) by new graph primitive functions. However, as per similar posts, at times there are conflicts.
As I am interested in better understanding graph encoding, I wish to investigate properties of different potential encodings. One simple/direct encoding is via Prüfer sequences. The Combinatorica package had two functions (one the inverse of the other) LabeledTreeToCode[] and CodeToLabeledTree[] to encode/decode the bijection between Prüfer codes and their graphs. However, simply using the following for a simple graph fail to instantiate, generating a general error that Combinatorica and permutation functions may be conflicting (which presumably they are).
totalOrder = Graph[{1 <-> 2, 2 <-> 3}]
Needs[Combinatorica`]
LabeledTreeToCode[totalOrder]
CodeToLabeledTree[totalOrder]
If I create the graph after calling Combinatorica` I get a series of errors (Table, Join, General) finally suppressing output.
How can I obtain the original functionality of these two functions from within Vers. 11.1.1? Or, is there a way within Vers. 11.1.1 to obtain this functionality without calling the old Combinatorica code?
Block[{$ContextPath}, Needs["Combinatorica`"]]
to load, then when you want a conbinatorica function, preface function name with Combinatorica'. In general, internal representations are not interchangeable, that is, a MMA graph object won't work with Combinatorica and vice-versa. $\endgroup$