Fix normalization of KontsevichGraph. The earlier `sort' totally destroyed the graph structure.
Fix normalization of KontsevichGraph. The earlier `sort' totally destroyed the graph structure.

A graph is represented by a vector where the ith element is a pair (j,k) representing edges i -> j, i -> k. Hence just sorting the list of pairs of targets (generally) does not give a relabeling of the same graph; the components of the pairs must be changed accordingly, otherwise the graph structure is lost.

The new (more expensive, but straightforward and correct) approach is to consider all possible relabelings in the correct way, and take the minimum of the existing heuristic (which worked for a fixed labeling).

rburing/kontsevich_graph_series-cpp