filtering self referencing edges