detect redundant nodes