I'm pretty sure this problem is P and not NP, but I'm having difficulty coming up with a polynomially bound algorithm to solve it.
You can :
n(n-1)/2
n-1
This will run in O(V²), which is polynomial.
O(V²)
Hope it helped.