add first-pass generic algorithm for shortcutting paths