public static boolean BFS(GraphNode n1, GraphNode n2) {
        if (n1 == null || n2 == null) return false;
        Queue<GraphNode> queue = new LinkedList<GraphNode>();
        queue.add(n1);
        while (!queue.isEmpty()) {
            GraphNode n = queue.remove();
            if (!n.isVisited) {
                n.isVisited = true;
                if (n == n2) return true;
                queue.addAll(n.adjacent);
            }
        }
        return false;
    }