Add algorithm for calculating transitive orientation of graph