iamdumb's blog

By iamdumb, history, 9 years ago, In English

I have seen many time people starting dfs with starting node -1 but I don't understand why do they do this.Can you please tell me why do they do so like in this example.

  • Vote: I like it
  • -2
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
  Vote: I like it +12 Vote: I do not like it

It's not starting point, it's a parent of verticle in DFS's spannig tree. There is no parent of root of the spanning tree, so it's equal to -1