3 ms·
I just tried this and several times the highest degree was already connected with the lowest degree, so I either had to pick another highest degree node (if the
by ajanuary 13y ago
I just tried this and several times the highest degree was already connected with the lowest degree, so I either had to pick another highest degree node (if there was a tie), pick the next highest degree and connect it with the lowest degree, or pick the next lowest degree and connect it with the highest degree. They all seemed to work out okay.
I find it interesting that yours appears simpler on the face of it, but has more edge cases. Seems like mine would be simpler if you were actually writing out the steps properly.