Immutable graph implementation + different traversals