Min cut problem
1. Removed self-loops
2. Replaced tail's values with head's after tail's removed