{"action":"created","issue":{"url":"https://api.github.com/repos/networkx/networkx/issues/2162","repository_url":"https://api.github.com/repos/networkx/networkx","labels_url":"https://api.github.com/repos/networkx/networkx/issues/2162/labels{/name}","comments_url":"https://api.github.com/repos/networkx/networkx/issues/2162/comments","events_url":"https://api.github.com/repos/networkx/networkx/issues/2162/events","html_url":"https://github.com/networkx/networkx/issues/2162","id":159916909,"number":2162,"title":"Fastest way to instanciate a digraph","user":{"login":"vallettea","id":371303,"avatar_url":"https://avatars.githubusercontent.com/u/371303?v=3","gravatar_id":"","url":"https://api.github.com/users/vallettea","html_url":"https://github.com/vallettea","followers_url":"https://api.github.com/users/vallettea/followers","following_url":"https://api.github.com/users/vallettea/following{/other_user}","gists_url":"https://api.github.com/users/vallettea/gists{/gist_id}","starred_url":"https://api.github.com/users/vallettea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vallettea/subscriptions","organizations_url":"https://api.github.com/users/vallettea/orgs","repos_url":"https://api.github.com/users/vallettea/repos","events_url":"https://api.github.com/users/vallettea/events{/privacy}","received_events_url":"https://api.github.com/users/vallettea/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-13T10:16:18Z","updated_at":"2016-06-13T13:34:53Z","closed_at":"2016-06-13T13:30:54Z","body":"Hello,\r\n\r\nI'm using `G = DiGraph(data = edges)` to instanciate a networkx graph and it takes me about half a second (22k nodes and 60k edges).\r\n\r\nIs there a faster way ?\r\nThanks"},"comment":{"url":"https://api.github.com/repos/networkx/networkx/issues/comments/225582087","html_url":"https://github.com/networkx/networkx/issues/2162#issuecomment-225582087","issue_url":"https://api.github.com/repos/networkx/networkx/issues/2162","id":225582087,"user":{"login":"dschult","id":915037,"avatar_url":"https://avatars.githubusercontent.com/u/915037?v=3","gravatar_id":"","url":"https://api.github.com/users/dschult","html_url":"https://github.com/dschult","followers_url":"https://api.github.com/users/dschult/followers","following_url":"https://api.github.com/users/dschult/following{/other_user}","gists_url":"https://api.github.com/users/dschult/gists{/gist_id}","starred_url":"https://api.github.com/users/dschult/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dschult/subscriptions","organizations_url":"https://api.github.com/users/dschult/orgs","repos_url":"https://api.github.com/users/dschult/repos","events_url":"https://api.github.com/users/dschult/events{/privacy}","received_events_url":"https://api.github.com/users/dschult/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T13:34:53Z","updated_at":"2016-06-13T13:34:53Z","body":"If your nodes are custom objects, you may be able to save a little time in the instantiation (but pay for it with lookups later) by using integers for nodes and keeping a list of the custom objects.  When you get graph results with integers as nodes and need to use the custom objects you'd look up the custom object in the list using the node (an integer) as the index.   Not sure it would speed up the overall processing--depends how much you would have to do lookups.  "}}
{"actor":{"display_login":"dschult"}}