Copy link
@ZmnSCPxj

ZmnSCPxj Mar 22, 2018

You need to keep track of the last removed nodes plural. So:

You keep track of two sets. One is the entire working set of nodes (including yourself). The other is the "last removed nodes".

In the bit-level while loop at line 53, before doing anything else you would clear the "last removed nodes" set.

When removing a node from the working set, you add it to the last removed nodes set.

On exit from the bit-level loop, you add back the last removed nodes set to the working set.

Basically we want to decimate the number of nodes to form a superhub, then when we go too far, back up by one step (i.e. one bit).

Thus if all nodes are known, every node will be able to generate the same superhub for each index i.