visitor: free edges properly