I am not able to understrand how does the first node that is source node get erased from the set? Please help me in understanding this

In the set, we are always finding the child pair that is destination and erasing it…but we are not removing the very first pair that is the source pair. Please help me with this.

@Ayushmahajan513,
Whenever we take out a parent from set, we also erase it, and then go to relax it’s children.

HEY, thank-you. I was missing some part of the code that’s why i was facing problem in understanding. Your reply made me to revisit the complete code and I understood my doubt .