A Linear Algorithm for Finding the Invariant Edges of an Edge