public UndirectedGraphNode cloneGraph(UndirectedGraphNode node) {
        if (node == null) {
            return null;
        }
        UndirectedGraphNode clone = new UndirectedGraphNode(node.label);
        Set<Integer> visited = new HashSet<>();
        Map<Integer, UndirectedGraphNode> map = new HashMap<>();
        map.put(clone.label, clone);
        dfs(node, clone, map, visited);
        return clone;
    }
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
https://leetcode.com/problems/clone-graph/
src/com/interview/graph/CloneGraph.java