{"action":"created","comment":{"url":"https://api.github.com/repos/gonum/graph/pulls/comments/80781306","pull_request_review_id":1812649,"id":80781306,"diff_hunk":"@@ -31,24 +31,46 @@ func (e Unorderable) Error() string {\n \treturn fmt.Sprintf(\"topo: no topological ordering: cyclic components: %v\", [][]graph.Node(e))\n }\n \n+func lexical(nodes []graph.Node) { sort.Sort(ordered.ByID(nodes)) }\n+\n // Sort performs a topological sort of the directed graph g returning the 'from' to 'to'\n // sort order. If a topological ordering is not possible, an Unorderable error is returned\n // listing cyclic components in g with each cyclic component's members sorted by ID. When\n // an Unorderable error is returned, each cyclic component's topological position within\n // the sorted nodes is marked with a nil graph.Node.\n func Sort(g graph.Directed) (sorted []graph.Node, err error) {\n \tsccs := TarjanSCC(g)\n-\tsorted = make([]graph.Node, 0, len(sccs))\n+\treturn finalizeSort(sccs, lexical)\n+}\n+\n+// SortStabilized performs a topological sort of the directed graph g returning the 'from'","path":"topo/tarjan.go","position":null,"original_position":17,"commit_id":"339063908c9462b65b2ab2573bda0cb29c8fe584","original_commit_id":"b24fc1c553534f95c46e41599252135036247b80","user":{"login":"kortschak","id":275221,"avatar_url":"https://avatars.githubusercontent.com/u/275221?v=3","gravatar_id":"","url":"https://api.github.com/users/kortschak","html_url":"https://github.com/kortschak","followers_url":"https://api.github.com/users/kortschak/followers","following_url":"https://api.github.com/users/kortschak/following{/other_user}","gists_url":"https://api.github.com/users/kortschak/gists{/gist_id}","starred_url":"https://api.github.com/users/kortschak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kortschak/subscriptions","organizations_url":"https://api.github.com/users/kortschak/orgs","repos_url":"https://api.github.com/users/kortschak/repos","events_url":"https://api.github.com/users/kortschak/events{/privacy}","received_events_url":"https://api.github.com/users/kortschak/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-09-27T20:01:54Z","updated_at":"2016-09-27T20:04:27Z","html_url":"https://github.com/gonum/graph/pull/181#discussion_r80781306","pull_request_url":"https://api.github.com/repos/gonum/graph/pulls/181","_links":{"self":{"href":"https://api.github.com/repos/gonum/graph/pulls/comments/80781306"},"html":{"href":"https://github.com/gonum/graph/pull/181#discussion_r80781306"},"pull_request":{"href":"https://api.github.com/repos/gonum/graph/pulls/181"}}},"pull_request":{"url":"https://api.github.com/repos/gonum/graph/pulls/181","id":86828323,"html_url":"https://github.com/gonum/graph/pull/181","diff_url":"https://github.com/gonum/graph/pull/181.diff","patch_url":"https://github.com/gonum/graph/pull/181.patch","issue_url":"https://api.github.com/repos/gonum/graph/issues/181","number":181,"state":"open","locked":false,"title":"topo: add lexically stabilised topological sort","user":{"login":"kortschak","id":275221,"avatar_url":"https://avatars.githubusercontent.com/u/275221?v=3","gravatar_id":"","url":"https://api.github.com/users/kortschak","html_url":"https://github.com/kortschak","followers_url":"https://api.github.com/users/kortschak/followers","following_url":"https://api.github.com/users/kortschak/following{/other_user}","gists_url":"https://api.github.com/users/kortschak/gists{/gist_id}","starred_url":"https://api.github.com/users/kortschak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kortschak/subscriptions","organizations_url":"https://api.github.com/users/kortschak/orgs","repos_url":"https://api.github.com/users/kortschak/repos","events_url":"https://api.github.com/users/kortschak/events{/privacy}","received_events_url":"https://api.github.com/users/kortschak/received_events","type":"User","site_admin":false},"body":"@btracey Please take a look.","created_at":"2016-09-26T22:07:33Z","updated_at":"2016-09-27T20:04:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d22544a51bc67deedf18dfad3a379628526da1e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gonum/graph/pulls/181/commits","review_comments_url":"https://api.github.com/repos/gonum/graph/pulls/181/comments","review_comment_url":"https://api.github.com/repos/gonum/graph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gonum/graph/issues/181/comments","statuses_url":"https://api.github.com/repos/gonum/graph/statuses/339063908c9462b65b2ab2573bda0cb29c8fe584","head":{"label":"gonum:stabilised","ref":"stabilised","sha":"339063908c9462b65b2ab2573bda0cb29c8fe584","user":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"repo":{"id":8589420,"name":"graph","full_name":"gonum/graph","owner":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gonum/graph","description":"Graph packages for the Go language","fork":false,"url":"https://api.github.com/repos/gonum/graph","forks_url":"https://api.github.com/repos/gonum/graph/forks","keys_url":"https://api.github.com/repos/gonum/graph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gonum/graph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gonum/graph/teams","hooks_url":"https://api.github.com/repos/gonum/graph/hooks","issue_events_url":"https://api.github.com/repos/gonum/graph/issues/events{/number}","events_url":"https://api.github.com/repos/gonum/graph/events","assignees_url":"https://api.github.com/repos/gonum/graph/assignees{/user}","branches_url":"https://api.github.com/repos/gonum/graph/branches{/branch}","tags_url":"https://api.github.com/repos/gonum/graph/tags","blobs_url":"https://api.github.com/repos/gonum/graph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gonum/graph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gonum/graph/git/refs{/sha}","trees_url":"https://api.github.com/repos/gonum/graph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gonum/graph/statuses/{sha}","languages_url":"https://api.github.com/repos/gonum/graph/languages","stargazers_url":"https://api.github.com/repos/gonum/graph/stargazers","contributors_url":"https://api.github.com/repos/gonum/graph/contributors","subscribers_url":"https://api.github.com/repos/gonum/graph/subscribers","subscription_url":"https://api.github.com/repos/gonum/graph/subscription","commits_url":"https://api.github.com/repos/gonum/graph/commits{/sha}","git_commits_url":"https://api.github.com/repos/gonum/graph/git/commits{/sha}","comments_url":"https://api.github.com/repos/gonum/graph/comments{/number}","issue_comment_url":"https://api.github.com/repos/gonum/graph/issues/comments{/number}","contents_url":"https://api.github.com/repos/gonum/graph/contents/{+path}","compare_url":"https://api.github.com/repos/gonum/graph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gonum/graph/merges","archive_url":"https://api.github.com/repos/gonum/graph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gonum/graph/downloads","issues_url":"https://api.github.com/repos/gonum/graph/issues{/number}","pulls_url":"https://api.github.com/repos/gonum/graph/pulls{/number}","milestones_url":"https://api.github.com/repos/gonum/graph/milestones{/number}","notifications_url":"https://api.github.com/repos/gonum/graph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gonum/graph/labels{/name}","releases_url":"https://api.github.com/repos/gonum/graph/releases{/id}","deployments_url":"https://api.github.com/repos/gonum/graph/deployments","created_at":"2013-03-05T21:22:45Z","updated_at":"2016-09-21T14:10:03Z","pushed_at":"2016-09-27T20:03:21Z","git_url":"git://github.com/gonum/graph.git","ssh_url":"git@github.com:gonum/graph.git","clone_url":"https://github.com/gonum/graph.git","svn_url":"https://github.com/gonum/graph","homepage":"","size":2012,"stargazers_count":164,"watchers_count":164,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":21,"forks":20,"open_issues":21,"watchers":164,"default_branch":"master"}},"base":{"label":"gonum:master","ref":"master","sha":"25f73999dc5832dd140f1a2ba9c978821cf781de","user":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"repo":{"id":8589420,"name":"graph","full_name":"gonum/graph","owner":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gonum/graph","description":"Graph packages for the Go language","fork":false,"url":"https://api.github.com/repos/gonum/graph","forks_url":"https://api.github.com/repos/gonum/graph/forks","keys_url":"https://api.github.com/repos/gonum/graph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gonum/graph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gonum/graph/teams","hooks_url":"https://api.github.com/repos/gonum/graph/hooks","issue_events_url":"https://api.github.com/repos/gonum/graph/issues/events{/number}","events_url":"https://api.github.com/repos/gonum/graph/events","assignees_url":"https://api.github.com/repos/gonum/graph/assignees{/user}","branches_url":"https://api.github.com/repos/gonum/graph/branches{/branch}","tags_url":"https://api.github.com/repos/gonum/graph/tags","blobs_url":"https://api.github.com/repos/gonum/graph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gonum/graph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gonum/graph/git/refs{/sha}","trees_url":"https://api.github.com/repos/gonum/graph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gonum/graph/statuses/{sha}","languages_url":"https://api.github.com/repos/gonum/graph/languages","stargazers_url":"https://api.github.com/repos/gonum/graph/stargazers","contributors_url":"https://api.github.com/repos/gonum/graph/contributors","subscribers_url":"https://api.github.com/repos/gonum/graph/subscribers","subscription_url":"https://api.github.com/repos/gonum/graph/subscription","commits_url":"https://api.github.com/repos/gonum/graph/commits{/sha}","git_commits_url":"https://api.github.com/repos/gonum/graph/git/commits{/sha}","comments_url":"https://api.github.com/repos/gonum/graph/comments{/number}","issue_comment_url":"https://api.github.com/repos/gonum/graph/issues/comments{/number}","contents_url":"https://api.github.com/repos/gonum/graph/contents/{+path}","compare_url":"https://api.github.com/repos/gonum/graph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gonum/graph/merges","archive_url":"https://api.github.com/repos/gonum/graph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gonum/graph/downloads","issues_url":"https://api.github.com/repos/gonum/graph/issues{/number}","pulls_url":"https://api.github.com/repos/gonum/graph/pulls{/number}","milestones_url":"https://api.github.com/repos/gonum/graph/milestones{/number}","notifications_url":"https://api.github.com/repos/gonum/graph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gonum/graph/labels{/name}","releases_url":"https://api.github.com/repos/gonum/graph/releases{/id}","deployments_url":"https://api.github.com/repos/gonum/graph/deployments","created_at":"2013-03-05T21:22:45Z","updated_at":"2016-09-21T14:10:03Z","pushed_at":"2016-09-27T20:03:21Z","git_url":"git://github.com/gonum/graph.git","ssh_url":"git@github.com:gonum/graph.git","clone_url":"https://github.com/gonum/graph.git","svn_url":"https://github.com/gonum/graph","homepage":"","size":2012,"stargazers_count":164,"watchers_count":164,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":21,"forks":20,"open_issues":21,"watchers":164,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gonum/graph/pulls/181"},"html":{"href":"https://github.com/gonum/graph/pull/181"},"issue":{"href":"https://api.github.com/repos/gonum/graph/issues/181"},"comments":{"href":"https://api.github.com/repos/gonum/graph/issues/181/comments"},"review_comments":{"href":"https://api.github.com/repos/gonum/graph/pulls/181/comments"},"review_comment":{"href":"https://api.github.com/repos/gonum/graph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gonum/graph/pulls/181/commits"},"statuses":{"href":"https://api.github.com/repos/gonum/graph/statuses/339063908c9462b65b2ab2573bda0cb29c8fe584"}}}}
{"actor":{"display_login":"kortschak"}}