Hint for CHEFDELIVERY

Hi everyone,
I am trying this problem CodeChef: Practical coding for everyone
I am new to graph problems.
I cant formulate how much edges are needed to not travel a road again