Determin if two nodes from text file are connected