{"action":"created","comment":{"url":"https://api.github.com/repos/jgrapht/jgrapht/pulls/comments/69398281","id":69398281,"diff_hunk":"@@ -532,6 +533,82 @@ private void reorder(Set<V> df, Set<V> db, Visited visited)\n     }\n \n     /**\n+     * This function is implemented recursively. Therefore only graphs without\n+     * any cycles are allowed.\n+     *\n+     * @param graph graph to look for ancestors in.\n+     * @param vertex the vertex to get the ancestors of.\n+     *\n+     * @return {@link List} of ancestors of the vertex in the given graph.\n+     */\n+    public static <V, E extends DefaultEdge> List<V> getAncestors(\n+        DirectedAcyclicGraph<V, E> graph,\n+        V vertex)\n+    {\n+\n+        List<V> ancestors = new ArrayList<>();\n+        ancestors = getAncestors(graph, vertex, ancestors);\n+        return ancestors;\n+    }\n+\n+    protected static <V, E extends DefaultEdge> List<V> getAncestors(","path":"jgrapht-core/src/main/java/org/jgrapht/experimental/dag/DirectedAcyclicGraph.java","position":35,"original_position":35,"commit_id":"d52394d509b9043698c191d052bed1eaa91b90f8","original_commit_id":"d52394d509b9043698c191d052bed1eaa91b90f8","user":{"login":"jsichi","id":632737,"avatar_url":"https://avatars.githubusercontent.com/u/632737?v=3","gravatar_id":"","url":"https://api.github.com/users/jsichi","html_url":"https://github.com/jsichi","followers_url":"https://api.github.com/users/jsichi/followers","following_url":"https://api.github.com/users/jsichi/following{/other_user}","gists_url":"https://api.github.com/users/jsichi/gists{/gist_id}","starred_url":"https://api.github.com/users/jsichi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsichi/subscriptions","organizations_url":"https://api.github.com/users/jsichi/orgs","repos_url":"https://api.github.com/users/jsichi/repos","events_url":"https://api.github.com/users/jsichi/events{/privacy}","received_events_url":"https://api.github.com/users/jsichi/received_events","type":"User","site_admin":false},"body":"But if you do keep it recursive, then for the helper method, use \"gather\" instead of \"get\".","created_at":"2016-07-03T22:34:04Z","updated_at":"2016-07-03T22:34:04Z","html_url":"https://github.com/jgrapht/jgrapht/pull/197#discussion_r69398281","pull_request_url":"https://api.github.com/repos/jgrapht/jgrapht/pulls/197","_links":{"self":{"href":"https://api.github.com/repos/jgrapht/jgrapht/pulls/comments/69398281"},"html":{"href":"https://github.com/jgrapht/jgrapht/pull/197#discussion_r69398281"},"pull_request":{"href":"https://api.github.com/repos/jgrapht/jgrapht/pulls/197"}}},"pull_request":{"url":"https://api.github.com/repos/jgrapht/jgrapht/pulls/197","id":68043827,"html_url":"https://github.com/jgrapht/jgrapht/pull/197","diff_url":"https://github.com/jgrapht/jgrapht/pull/197.diff","patch_url":"https://github.com/jgrapht/jgrapht/pull/197.patch","issue_url":"https://api.github.com/repos/jgrapht/jgrapht/issues/197","number":197,"state":"open","locked":false,"title":"Implemented various graph utility methods.","user":{"login":"zaunerc","id":14179675,"avatar_url":"https://avatars.githubusercontent.com/u/14179675?v=3","gravatar_id":"","url":"https://api.github.com/users/zaunerc","html_url":"https://github.com/zaunerc","followers_url":"https://api.github.com/users/zaunerc/followers","following_url":"https://api.github.com/users/zaunerc/following{/other_user}","gists_url":"https://api.github.com/users/zaunerc/gists{/gist_id}","starred_url":"https://api.github.com/users/zaunerc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaunerc/subscriptions","organizations_url":"https://api.github.com/users/zaunerc/orgs","repos_url":"https://api.github.com/users/zaunerc/repos","events_url":"https://api.github.com/users/zaunerc/events{/privacy}","received_events_url":"https://api.github.com/users/zaunerc/received_events","type":"User","site_admin":false},"body":"We use the JGraphT library in one of our software projects. We thought a few utility methods for common use cases were missing and implemented them ourselves. A quick Google search confirms that other projects would also benefit if the JGraphT library would implement graph utility methods for such common use cases. See e.g. https://github.com/Netflix/Nicobar/blob/84074b5/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java.","created_at":"2016-04-27T12:21:30Z","updated_at":"2016-07-03T22:34:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b7307b2a89098654d9c774858eaa96521c64fa9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jgrapht/jgrapht/pulls/197/commits","review_comments_url":"https://api.github.com/repos/jgrapht/jgrapht/pulls/197/comments","review_comment_url":"https://api.github.com/repos/jgrapht/jgrapht/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jgrapht/jgrapht/issues/197/comments","statuses_url":"https://api.github.com/repos/jgrapht/jgrapht/statuses/d52394d509b9043698c191d052bed1eaa91b90f8","head":{"label":"danube-development:add_utility_methods","ref":"add_utility_methods","sha":"d52394d509b9043698c191d052bed1eaa91b90f8","user":{"login":"danube-development","id":14179641,"avatar_url":"https://avatars.githubusercontent.com/u/14179641?v=3","gravatar_id":"","url":"https://api.github.com/users/danube-development","html_url":"https://github.com/danube-development","followers_url":"https://api.github.com/users/danube-development/followers","following_url":"https://api.github.com/users/danube-development/following{/other_user}","gists_url":"https://api.github.com/users/danube-development/gists{/gist_id}","starred_url":"https://api.github.com/users/danube-development/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danube-development/subscriptions","organizations_url":"https://api.github.com/users/danube-development/orgs","repos_url":"https://api.github.com/users/danube-development/repos","events_url":"https://api.github.com/users/danube-development/events{/privacy}","received_events_url":"https://api.github.com/users/danube-development/received_events","type":"Organization","site_admin":false},"repo":{"id":49424887,"name":"jgrapht","full_name":"danube-development/jgrapht","owner":{"login":"danube-development","id":14179641,"avatar_url":"https://avatars.githubusercontent.com/u/14179641?v=3","gravatar_id":"","url":"https://api.github.com/users/danube-development","html_url":"https://github.com/danube-development","followers_url":"https://api.github.com/users/danube-development/followers","following_url":"https://api.github.com/users/danube-development/following{/other_user}","gists_url":"https://api.github.com/users/danube-development/gists{/gist_id}","starred_url":"https://api.github.com/users/danube-development/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danube-development/subscriptions","organizations_url":"https://api.github.com/users/danube-development/orgs","repos_url":"https://api.github.com/users/danube-development/repos","events_url":"https://api.github.com/users/danube-development/events{/privacy}","received_events_url":"https://api.github.com/users/danube-development/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/danube-development/jgrapht","description":"Fork of JGraphT project","fork":true,"url":"https://api.github.com/repos/danube-development/jgrapht","forks_url":"https://api.github.com/repos/danube-development/jgrapht/forks","keys_url":"https://api.github.com/repos/danube-development/jgrapht/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danube-development/jgrapht/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danube-development/jgrapht/teams","hooks_url":"https://api.github.com/repos/danube-development/jgrapht/hooks","issue_events_url":"https://api.github.com/repos/danube-development/jgrapht/issues/events{/number}","events_url":"https://api.github.com/repos/danube-development/jgrapht/events","assignees_url":"https://api.github.com/repos/danube-development/jgrapht/assignees{/user}","branches_url":"https://api.github.com/repos/danube-development/jgrapht/branches{/branch}","tags_url":"https://api.github.com/repos/danube-development/jgrapht/tags","blobs_url":"https://api.github.com/repos/danube-development/jgrapht/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danube-development/jgrapht/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danube-development/jgrapht/git/refs{/sha}","trees_url":"https://api.github.com/repos/danube-development/jgrapht/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danube-development/jgrapht/statuses/{sha}","languages_url":"https://api.github.com/repos/danube-development/jgrapht/languages","stargazers_url":"https://api.github.com/repos/danube-development/jgrapht/stargazers","contributors_url":"https://api.github.com/repos/danube-development/jgrapht/contributors","subscribers_url":"https://api.github.com/repos/danube-development/jgrapht/subscribers","subscription_url":"https://api.github.com/repos/danube-development/jgrapht/subscription","commits_url":"https://api.github.com/repos/danube-development/jgrapht/commits{/sha}","git_commits_url":"https://api.github.com/repos/danube-development/jgrapht/git/commits{/sha}","comments_url":"https://api.github.com/repos/danube-development/jgrapht/comments{/number}","issue_comment_url":"https://api.github.com/repos/danube-development/jgrapht/issues/comments{/number}","contents_url":"https://api.github.com/repos/danube-development/jgrapht/contents/{+path}","compare_url":"https://api.github.com/repos/danube-development/jgrapht/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danube-development/jgrapht/merges","archive_url":"https://api.github.com/repos/danube-development/jgrapht/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danube-development/jgrapht/downloads","issues_url":"https://api.github.com/repos/danube-development/jgrapht/issues{/number}","pulls_url":"https://api.github.com/repos/danube-development/jgrapht/pulls{/number}","milestones_url":"https://api.github.com/repos/danube-development/jgrapht/milestones{/number}","notifications_url":"https://api.github.com/repos/danube-development/jgrapht/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danube-development/jgrapht/labels{/name}","releases_url":"https://api.github.com/repos/danube-development/jgrapht/releases{/id}","deployments_url":"https://api.github.com/repos/danube-development/jgrapht/deployments","created_at":"2016-01-11T12:26:27Z","updated_at":"2016-01-11T12:27:11Z","pushed_at":"2016-06-29T13:19:07Z","git_url":"git://github.com/danube-development/jgrapht.git","ssh_url":"git@github.com:danube-development/jgrapht.git","clone_url":"https://github.com/danube-development/jgrapht.git","svn_url":"https://github.com/danube-development/jgrapht","homepage":"http://www.jgrapht.org","size":5800,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jgrapht:master","ref":"master","sha":"c3adaefd5721b65b066ce4941ac09599eaf23dbd","user":{"login":"jgrapht","id":1624681,"avatar_url":"https://avatars.githubusercontent.com/u/1624681?v=3","gravatar_id":"","url":"https://api.github.com/users/jgrapht","html_url":"https://github.com/jgrapht","followers_url":"https://api.github.com/users/jgrapht/followers","following_url":"https://api.github.com/users/jgrapht/following{/other_user}","gists_url":"https://api.github.com/users/jgrapht/gists{/gist_id}","starred_url":"https://api.github.com/users/jgrapht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgrapht/subscriptions","organizations_url":"https://api.github.com/users/jgrapht/orgs","repos_url":"https://api.github.com/users/jgrapht/repos","events_url":"https://api.github.com/users/jgrapht/events{/privacy}","received_events_url":"https://api.github.com/users/jgrapht/received_events","type":"Organization","site_admin":false},"repo":{"id":3969325,"name":"jgrapht","full_name":"jgrapht/jgrapht","owner":{"login":"jgrapht","id":1624681,"avatar_url":"https://avatars.githubusercontent.com/u/1624681?v=3","gravatar_id":"","url":"https://api.github.com/users/jgrapht","html_url":"https://github.com/jgrapht","followers_url":"https://api.github.com/users/jgrapht/followers","following_url":"https://api.github.com/users/jgrapht/following{/other_user}","gists_url":"https://api.github.com/users/jgrapht/gists{/gist_id}","starred_url":"https://api.github.com/users/jgrapht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgrapht/subscriptions","organizations_url":"https://api.github.com/users/jgrapht/orgs","repos_url":"https://api.github.com/users/jgrapht/repos","events_url":"https://api.github.com/users/jgrapht/events{/privacy}","received_events_url":"https://api.github.com/users/jgrapht/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jgrapht/jgrapht","description":"Master repository for the JGraphT project","fork":true,"url":"https://api.github.com/repos/jgrapht/jgrapht","forks_url":"https://api.github.com/repos/jgrapht/jgrapht/forks","keys_url":"https://api.github.com/repos/jgrapht/jgrapht/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jgrapht/jgrapht/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jgrapht/jgrapht/teams","hooks_url":"https://api.github.com/repos/jgrapht/jgrapht/hooks","issue_events_url":"https://api.github.com/repos/jgrapht/jgrapht/issues/events{/number}","events_url":"https://api.github.com/repos/jgrapht/jgrapht/events","assignees_url":"https://api.github.com/repos/jgrapht/jgrapht/assignees{/user}","branches_url":"https://api.github.com/repos/jgrapht/jgrapht/branches{/branch}","tags_url":"https://api.github.com/repos/jgrapht/jgrapht/tags","blobs_url":"https://api.github.com/repos/jgrapht/jgrapht/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jgrapht/jgrapht/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jgrapht/jgrapht/git/refs{/sha}","trees_url":"https://api.github.com/repos/jgrapht/jgrapht/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jgrapht/jgrapht/statuses/{sha}","languages_url":"https://api.github.com/repos/jgrapht/jgrapht/languages","stargazers_url":"https://api.github.com/repos/jgrapht/jgrapht/stargazers","contributors_url":"https://api.github.com/repos/jgrapht/jgrapht/contributors","subscribers_url":"https://api.github.com/repos/jgrapht/jgrapht/subscribers","subscription_url":"https://api.github.com/repos/jgrapht/jgrapht/subscription","commits_url":"https://api.github.com/repos/jgrapht/jgrapht/commits{/sha}","git_commits_url":"https://api.github.com/repos/jgrapht/jgrapht/git/commits{/sha}","comments_url":"https://api.github.com/repos/jgrapht/jgrapht/comments{/number}","issue_comment_url":"https://api.github.com/repos/jgrapht/jgrapht/issues/comments{/number}","contents_url":"https://api.github.com/repos/jgrapht/jgrapht/contents/{+path}","compare_url":"https://api.github.com/repos/jgrapht/jgrapht/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jgrapht/jgrapht/merges","archive_url":"https://api.github.com/repos/jgrapht/jgrapht/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jgrapht/jgrapht/downloads","issues_url":"https://api.github.com/repos/jgrapht/jgrapht/issues{/number}","pulls_url":"https://api.github.com/repos/jgrapht/jgrapht/pulls{/number}","milestones_url":"https://api.github.com/repos/jgrapht/jgrapht/milestones{/number}","notifications_url":"https://api.github.com/repos/jgrapht/jgrapht/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jgrapht/jgrapht/labels{/name}","releases_url":"https://api.github.com/repos/jgrapht/jgrapht/releases{/id}","deployments_url":"https://api.github.com/repos/jgrapht/jgrapht/deployments","created_at":"2012-04-09T05:30:23Z","updated_at":"2016-07-03T14:06:51Z","pushed_at":"2016-07-01T18:31:53Z","git_url":"git://github.com/jgrapht/jgrapht.git","ssh_url":"git@github.com:jgrapht/jgrapht.git","clone_url":"https://github.com/jgrapht/jgrapht.git","svn_url":"https://github.com/jgrapht/jgrapht","homepage":"http://www.jgrapht.org","size":7480,"stargazers_count":688,"watchers_count":688,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":293,"mirror_url":null,"open_issues_count":65,"forks":293,"open_issues":65,"watchers":688,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jgrapht/jgrapht/pulls/197"},"html":{"href":"https://github.com/jgrapht/jgrapht/pull/197"},"issue":{"href":"https://api.github.com/repos/jgrapht/jgrapht/issues/197"},"comments":{"href":"https://api.github.com/repos/jgrapht/jgrapht/issues/197/comments"},"review_comments":{"href":"https://api.github.com/repos/jgrapht/jgrapht/pulls/197/comments"},"review_comment":{"href":"https://api.github.com/repos/jgrapht/jgrapht/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jgrapht/jgrapht/pulls/197/commits"},"statuses":{"href":"https://api.github.com/repos/jgrapht/jgrapht/statuses/d52394d509b9043698c191d052bed1eaa91b90f8"}}}}
{"actor":{"display_login":"jsichi"}}