On the left, the original path. On the right, the greedily simplified path.
White is the start
Pink are obstacles
Red is the goal
Green with blue outline are waypoints
Red-dotted line denotes the path