you can also use `std::set` for a list of node ids. For this small problems, there should be no performance issue. just suggestion