title: Graph traversal in Scala
body: <p>Graph traversal (DFS and BFS) implementations I know use a <em>mutable</em> set of "visited" vertices. How would you implement them with only <em>immutable</em> data structures?</p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/5471234/how-to-implement-a-dfs-with-immutable-data-types">this question</a>. Now I wonder if there are also other solutions </p>