{"action":"created","issue":{"url":"https://api.github.com/repos/networkx/networkx/issues/2234","repository_url":"https://api.github.com/repos/networkx/networkx","labels_url":"https://api.github.com/repos/networkx/networkx/issues/2234/labels{/name}","comments_url":"https://api.github.com/repos/networkx/networkx/issues/2234/comments","events_url":"https://api.github.com/repos/networkx/networkx/issues/2234/events","html_url":"https://github.com/networkx/networkx/issues/2234","id":173671873,"number":2234,"title":"shortest_path_length behavior in disconnected graph","user":{"login":"idc9","id":906398,"avatar_url":"https://avatars.githubusercontent.com/u/906398?v=3","gravatar_id":"","url":"https://api.github.com/users/idc9","html_url":"https://github.com/idc9","followers_url":"https://api.github.com/users/idc9/followers","following_url":"https://api.github.com/users/idc9/following{/other_user}","gists_url":"https://api.github.com/users/idc9/gists{/gist_id}","starred_url":"https://api.github.com/users/idc9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idc9/subscriptions","organizations_url":"https://api.github.com/users/idc9/orgs","repos_url":"https://api.github.com/users/idc9/repos","events_url":"https://api.github.com/users/idc9/events{/privacy}","received_events_url":"https://api.github.com/users/idc9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-28T22:33:02Z","updated_at":"2016-08-30T20:55:13Z","closed_at":null,"body":"Currently shortest_path_length(G, u, v) raises an error if there is no path between nodes u and v. It might be worth changing this to return infinity (or at least adding the option to do so). Some algorithms, such as global_efficiency, treat the path length between two disconnected nodes as infinity. "},"comment":{"url":"https://api.github.com/repos/networkx/networkx/issues/comments/243577709","html_url":"https://github.com/networkx/networkx/issues/2234#issuecomment-243577709","issue_url":"https://api.github.com/repos/networkx/networkx/issues/2234","id":243577709,"user":{"login":"hagberg","id":187875,"avatar_url":"https://avatars.githubusercontent.com/u/187875?v=3","gravatar_id":"","url":"https://api.github.com/users/hagberg","html_url":"https://github.com/hagberg","followers_url":"https://api.github.com/users/hagberg/followers","following_url":"https://api.github.com/users/hagberg/following{/other_user}","gists_url":"https://api.github.com/users/hagberg/gists{/gist_id}","starred_url":"https://api.github.com/users/hagberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagberg/subscriptions","organizations_url":"https://api.github.com/users/hagberg/orgs","repos_url":"https://api.github.com/users/hagberg/repos","events_url":"https://api.github.com/users/hagberg/events{/privacy}","received_events_url":"https://api.github.com/users/hagberg/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T20:55:13Z","updated_at":"2016-08-30T20:55:13Z","body":"Raising an exception here doesn't mean that it is a software error it means that there is a problem with the output of the algorithm.  In this case the error is trying to compute the shortest path between disconnected nodes.   We have other exceptions like that where we try to catch input errors that cause the algorithms to produce results that are reasonable by wrong. Those are hard to spot.\r\n\r\nI'd prefer raising the exception to be explicit about the disconnected nodes and lack of a path.  In that case the user has to decide how to handle the situation - setting to inf if that is appropriate.  There is less chance of a silently ignored error when dividing by inf or some similar situation.  "}}
{"actor":{"display_login":"hagberg"}}