{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/911","repository_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl","labels_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/911/labels{/name}","comments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/911/comments","events_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/911/events","html_url":"https://github.com/JuliaOpt/JuMP.jl/issues/911","id":193852064,"number":911,"title":"Faster way to add constraints?","user":{"login":"kibaekkim","id":8064547,"avatar_url":"https://avatars.githubusercontent.com/u/8064547?v=3","gravatar_id":"","url":"https://api.github.com/users/kibaekkim","html_url":"https://github.com/kibaekkim","followers_url":"https://api.github.com/users/kibaekkim/followers","following_url":"https://api.github.com/users/kibaekkim/following{/other_user}","gists_url":"https://api.github.com/users/kibaekkim/gists{/gist_id}","starred_url":"https://api.github.com/users/kibaekkim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kibaekkim/subscriptions","organizations_url":"https://api.github.com/users/kibaekkim/orgs","repos_url":"https://api.github.com/users/kibaekkim/repos","events_url":"https://api.github.com/users/kibaekkim/events{/privacy}","received_events_url":"https://api.github.com/users/kibaekkim/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-06T18:44:11Z","updated_at":"2016-12-06T18:52:00Z","closed_at":"2016-12-06T18:52:00Z","body":"I am wondering if there is a faster way to add the following constraints. This seems taking long time (more than 1 hour; quitted after 1 hour).\r\n```julia\r\n@constraint(m, cons[v=V,i=I; haskey(B,(v,i)) == true], sum{x[e], e=E; e[1] == v && e[2] == i} - sum{x[e], e=E; e[1] == v && e[3] == i} == B[v,i])\r\n@constraint(m, cons[v=V,i=I; haskey(B,(v,i)) == false], sum{x[e], e=E; e[1] == v && e[2] == i} - sum{x[e], e=E; e[1] == v && e[3] == i} == 0)\r\n```\r\nwhere |I| > 80000 and |V| = 200."},"comment":{"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/comments/265237401","html_url":"https://github.com/JuliaOpt/JuMP.jl/issues/911#issuecomment-265237401","issue_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/911","id":265237401,"user":{"login":"mlubin","id":1733683,"avatar_url":"https://avatars.githubusercontent.com/u/1733683?v=3","gravatar_id":"","url":"https://api.github.com/users/mlubin","html_url":"https://github.com/mlubin","followers_url":"https://api.github.com/users/mlubin/followers","following_url":"https://api.github.com/users/mlubin/following{/other_user}","gists_url":"https://api.github.com/users/mlubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mlubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlubin/subscriptions","organizations_url":"https://api.github.com/users/mlubin/orgs","repos_url":"https://api.github.com/users/mlubin/repos","events_url":"https://api.github.com/users/mlubin/events{/privacy}","received_events_url":"https://api.github.com/users/mlubin/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T18:52:00Z","updated_at":"2016-12-06T18:52:00Z","body":"Yes, loop through the existing keys/edges directly instead of looping through all possible combinations and checking if they exist, just as you would if you were writing an algorithm on the graph. JuMP does not do any magic here."}}
{"actor":{"display_login":"mlubin"}}