Added "areConnected" to check if two nodes from Graph are connected.