Being ill and drowsy with medication, this week I stuck to surfing, and saw this math problem, to be precise its graph theory :) Among the various ideas, i suggested Warshall's algorithm for shortest path. If its planer there is Kuratowski's theorem. Which will work better now?