Closed simonlindholm closed 4 years ago
Yeah I'm not sure if I totally understand it either but I'll look into it.
Should be fixed now (was missing a dsu.get()). Thanks!
Sweet!
Also, I should ask, would you be fine with CC0-licensing the reconstruction and having it be part of upstream KACTL? (I code-golfed it a bit: https://github.com/kth-competitive-programming/kactl/compare/master...simonlindholm:dmst-reconstruction )
yeah sure
With https://github.com/bqi343/USACO/blob/master/Implementations/content/graphs%20(12)/Misc/DirectedMST.h,
ends up with
inEdge.s == -1
in the restore loop, causing it to misbehave and in practice later hit this assert:assert(i == r ? in[i].s == -1 : in[i].s == i);
.Found while looking into importing it into KACTL, through the directed MST stress test: https://github.com/kth-competitive-programming/kactl/blob/master/stress-tests/graph/DirectedMST.cpp. I don't understand the restoration algorithm well enough to know how to patch it.