let edgefilter tree filter_fun = IdtMap.fold (fun x y a -> if (filter_fun x y) then y::a else a) tree.treeEdges []