UndirectedGraphNode cloneNodes(UndirectedGraphNode node) {
		if (node == null)
			return null;
		if (map.containsKey(node))
			return map.get(node);

		UndirectedGraphNode newNode = new UndirectedGraphNode(node.label);
		map.put(node, newNode);
		List<UndirectedGraphNode> neighborList = new ArrayList<UndirectedGraphNode>();
		for (UndirectedGraphNode listNode : node.neighbors) {
			neighborList.add(cloneNodes(listNode));
		}
		newNode.neighbors = neighborList;
		return newNode;
	}