Considering that each instance of std::unordered_set<uint_32> is still going to result in at least one more allocation on the heap (internally), the actually achievable savings have a hard bound. You are going to save less than 50% of the necessary heap allocations.
One important thing is that, once a node is created, it won't be deleted until the whole tree will be deleted.
Re-allocations are still happening in an std::vector as it grows. In contrast to immovable allocations on the heap, this additionally involves moving already allocated nodes. Depending on what other attributes your node elements have, that may be even costlier. You will also need to make sure that your node class is compatible with move semantics.
With std::unordered_set also allocating on the heap, you won't be able to avoid the resulting memory fragmentation either.
All in all, unless you expect to be limited by the performance of heap allocations, or you have a use case for order-independent tree traversal, compacting node instances is likely not going to be worth the effort.
A potentially reasonable optimization would be to swap std::unordered_set<node*> for std::unordered_set<node>. Unless you need that indirection in that place (external pointers?), that saves you just as much as your own attempt, without sacrificing debug capabilities.
Implementing the necessary hash function and equality operator for node is usually easy.
If performance is a real concern, and you also have a (reasonable) upper bound on the number of children per node, you may consider replacing std::unordered_set<uint_32> children by std::array<uint_32, n> children instead with use of std::find() for detecting collisions.
The reason for that is quite simple, ensuring that node becomes TriviallyCopyable which reduces re-allocations to a plain memcpy internally. For up to 16 children or so, this is likely going to be neutral in terms of memory consumption, but still faster.
std::unordered_set<str::unique_ptr<node>> childrenand deleting the tree is as simple aschildren.clear()sdt::unordered_set? This is a quite heavy and slow data structure. How many children can you have in each node in the worst cases? Is this number bounded?new(if not overloaded or in place new), andstd::vectorwill create the elements in the heap.