{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaGraphs/LightGraphs.jl/issues/243","labels_url":"https://api.github.com/repos/JuliaGraphs/LightGraphs.jl/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/JuliaGraphs/LightGraphs.jl/issues/243/comments","events_url":"https://api.github.com/repos/JuliaGraphs/LightGraphs.jl/issues/243/events","html_url":"https://github.com/JuliaGraphs/LightGraphs.jl/issues/243","id":118844599,"number":243,"title":"Implement random sampling without replacement for Graph(m,n)","user":{"login":"jiahao","id":1732,"avatar_url":"https://avatars.githubusercontent.com/u/1732?v=3","gravatar_id":"","url":"https://api.github.com/users/jiahao","html_url":"https://github.com/jiahao","followers_url":"https://api.github.com/users/jiahao/followers","following_url":"https://api.github.com/users/jiahao/following{/other_user}","gists_url":"https://api.github.com/users/jiahao/gists{/gist_id}","starred_url":"https://api.github.com/users/jiahao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiahao/subscriptions","organizations_url":"https://api.github.com/users/jiahao/orgs","repos_url":"https://api.github.com/users/jiahao/repos","events_url":"https://api.github.com/users/jiahao/events{/privacy}","received_events_url":"https://api.github.com/users/jiahao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaGraphs/LightGraphs.jl/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"sbromberger","id":941359,"avatar_url":"https://avatars.githubusercontent.com/u/941359?v=3","gravatar_id":"","url":"https://api.github.com/users/sbromberger","html_url":"https://github.com/sbromberger","followers_url":"https://api.github.com/users/sbromberger/followers","following_url":"https://api.github.com/users/sbromberger/following{/other_user}","gists_url":"https://api.github.com/users/sbromberger/gists{/gist_id}","starred_url":"https://api.github.com/users/sbromberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbromberger/subscriptions","organizations_url":"https://api.github.com/users/sbromberger/orgs","repos_url":"https://api.github.com/users/sbromberger/repos","events_url":"https://api.github.com/users/sbromberger/events{/privacy}","received_events_url":"https://api.github.com/users/sbromberger/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-11-25T14:14:32Z","updated_at":"2015-11-28T20:33:30Z","closed_at":"2015-11-28T20:33:30Z","body":"While testing JuliaLang/julia#14112 I seem to have found a situation where generating a random graph with more edges than is theoretically possible hangs the constructor:\r\n\r\n```jl\r\njulia> Graph(10,45)\r\n{10, 45} undirected graph\r\n\r\njulia> Graph(10,46)\r\n^CERROR: InterruptException:\r\n in call at random.jl:471\r\n in call at /Users/jiahao/.julia/v0.5/LightGraphs/src/randgraphs.jl:7\r\n in eval at ./boot.jl:263\r\n```\r\n\r\nI presume the code for adding enough edges tries to guarantee that the resulting graph has the exact number of edges requested, in which case this problem might be avoided with a check to see if `ne > nv*(nv-1) ÷ 2` and throw an error if true."}}