Updated TLP to check for degenerate edges, edges with non-existent vertices, and duplicate edges.