public static void bfs(UndirectedGraphNode node){
        if(node == null) return;

        Queue<UndirectedGraphNode> queue = new LinkedList<UndirectedGraphNode>();
        queue.add(node);
        node.visited = true;

        while(!queue.isEmpty()){
            int size = queue.size();
            for(int i = 0; i < size; i++){
                UndirectedGraphNode n = queue.poll();
                System.out.print(n.label + " ");
                for(UndirectedGraphNode neighbor : n.neighbors){
                    if(neighbor.visited == false){
                        queue.add(neighbor);
                        neighbor.visited = true;
                    }
                }
            }
        }
    }