Can someone please explain the solution of this Problem

Problem Statement: https://www.spoj.com/problems/GHOSTS/

no question clarity, what is a and b not mentioned in the question

‘a’ and ‘b’ are connected edges.