Implement getBestEffortTopographicallySortedNodesByRow on AbstractDirectedGraph

Summary: This is required for D9847.

Test Plan: It works.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9956