Graph algorithm
Brute force