Does this help? Maybe. I don't know.
Don't add edges to the unordered_set's of to_nodes