{"action":"created","issue":{"url":"https://api.github.com/repos/networkx/networkx/issues/1632","labels_url":"https://api.github.com/repos/networkx/networkx/issues/1632/labels{/name}","comments_url":"https://api.github.com/repos/networkx/networkx/issues/1632/comments","events_url":"https://api.github.com/repos/networkx/networkx/issues/1632/events","html_url":"https://github.com/networkx/networkx/issues/1632","id":92154447,"number":1632,"title":"Functions that currently produce lists which can (should) produce iterators","user":{"login":"MridulS","id":5363860,"avatar_url":"https://avatars.githubusercontent.com/u/5363860?v=3","gravatar_id":"","url":"https://api.github.com/users/MridulS","html_url":"https://github.com/MridulS","followers_url":"https://api.github.com/users/MridulS/followers","following_url":"https://api.github.com/users/MridulS/following{/other_user}","gists_url":"https://api.github.com/users/MridulS/gists{/gist_id}","starred_url":"https://api.github.com/users/MridulS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MridulS/subscriptions","organizations_url":"https://api.github.com/users/MridulS/orgs","repos_url":"https://api.github.com/users/MridulS/repos","events_url":"https://api.github.com/users/MridulS/events{/privacy}","received_events_url":"https://api.github.com/users/MridulS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-30T17:40:29Z","updated_at":"2015-07-11T12:00:13Z","closed_at":null,"body":"We should discuss about various functions/algorithms (non core classes methods) that generate lists which can (should) produce iterators.\r\n\r\n* `cluster.triangles()`\r\n* `cluster.clustering()`\r\n* `cluster.square_clustering()`\r\n* `boundary.edge_boudary()`\r\n* `boundary.node_boundary()`\r\n* `core.core_number()`\r\n* `dag.topological_sort()`\r\n* `dag.dag_longest_path()` \r\n* `approximation.kcomponents.k_components()`\r\n* `assortativity.connectivity.connectivity()`\r\n* `bipartite.basic.color()`\r\n* ...........\r\n* ..........\r\n* .........\r\n\r\nLooking forward to inputs\r\n@dschult @hagberg @chebee7i @jfinkels @jtorrents @ysitu\r\n"},"comment":{"url":"https://api.github.com/repos/networkx/networkx/issues/comments/120607857","html_url":"https://github.com/networkx/networkx/issues/1632#issuecomment-120607857","issue_url":"https://api.github.com/repos/networkx/networkx/issues/1632","id":120607857,"user":{"login":"MisterSheik","id":730137,"avatar_url":"https://avatars.githubusercontent.com/u/730137?v=3","gravatar_id":"","url":"https://api.github.com/users/MisterSheik","html_url":"https://github.com/MisterSheik","followers_url":"https://api.github.com/users/MisterSheik/followers","following_url":"https://api.github.com/users/MisterSheik/following{/other_user}","gists_url":"https://api.github.com/users/MisterSheik/gists{/gist_id}","starred_url":"https://api.github.com/users/MisterSheik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MisterSheik/subscriptions","organizations_url":"https://api.github.com/users/MisterSheik/orgs","repos_url":"https://api.github.com/users/MisterSheik/repos","events_url":"https://api.github.com/users/MisterSheik/events{/privacy}","received_events_url":"https://api.github.com/users/MisterSheik/received_events","type":"User","site_admin":false},"created_at":"2015-07-11T12:00:13Z","updated_at":"2015-07-11T12:00:13Z","body":"One of the difficulties with generators as opposed to returning lists is that an caller might accidentally change the graph used in the call while they are processing the iterator.  It might be nice to raise a `GraphChangedError` in that case.\r\n\r\nFor example, I reimplemented `topological_sort` as an generator.  I could intercept `KeyError` and replace it with `GraphChangedError`.  Also, it's possible for the a user changing the graph while the generator is being processed to fool the algorithm into thinking that there's a cycle, which is unfortunate."}}