{"action":"created","issue":{"url":"https://api.github.com/repos/Engelberg/ubergraph/issues/12","labels_url":"https://api.github.com/repos/Engelberg/ubergraph/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/Engelberg/ubergraph/issues/12/comments","events_url":"https://api.github.com/repos/Engelberg/ubergraph/issues/12/events","html_url":"https://github.com/Engelberg/ubergraph/issues/12","id":121895911,"number":12,"title":"Undirected graphs are not equal if their undirected edges \"have different direction\"","user":{"login":"sergeny","id":5010099,"avatar_url":"https://avatars.githubusercontent.com/u/5010099?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeny","html_url":"https://github.com/sergeny","followers_url":"https://api.github.com/users/sergeny/followers","following_url":"https://api.github.com/users/sergeny/following{/other_user}","gists_url":"https://api.github.com/users/sergeny/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeny/subscriptions","organizations_url":"https://api.github.com/users/sergeny/orgs","repos_url":"https://api.github.com/users/sergeny/repos","events_url":"https://api.github.com/users/sergeny/events{/privacy}","received_events_url":"https://api.github.com/users/sergeny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-13T03:40:28Z","updated_at":"2015-12-23T17:44:57Z","closed_at":null,"body":"That is, if one undirected graph says A->B is the real one and B->A is the mirror one, while another graph says the opposite, they would not be considered equal. Tested in 0.1.7 and 0.1.8.\r\n```\r\n=> (def G1 (ubergraph/add-edges (ubergraph/add-nodes (ubergraph/graph) \"first\" \"second\") [\"first\" \"second\"]))\r\n=> (def G2 (ubergraph/add-edges (ubergraph/add-nodes (ubergraph/graph) \"second\" \"first\") [\"second\" \"first\"]))\r\n=> (= G1 G2)\r\nfalse\r\n```\r\n\r\nNote, however, that graph equality can be a surprisingly complicated issue. Say, we have 100 parallel edges between A and B. Then in order to check for equality, we'd have to find out if there's a permutation of the edges so that the corresponding pairs are equal, which may potentially require quadratic time to compare each edge's attribute to each edge's attribute. It would probably require a lot of very subtle unit tests to ensure a consistent semantics, as there are just too many possibilities. Imagine a slew of edges between A and B, some going one way, some the other, some undirectional, some having no attribute, some having {nil []} as the attribute map, some having {nil '()} as the attribute map, some having {nil nil} as the attribute map, some having {} as the attribute map... \r\n\r\nE.g. start from\r\n```\r\n(ug/add-attrs (ug/multigraph [[] {} '()]) [] {})\r\n```\r\nand it will get complicated very quickly."},"comment":{"url":"https://api.github.com/repos/Engelberg/ubergraph/issues/comments/166954179","html_url":"https://github.com/Engelberg/ubergraph/issues/12#issuecomment-166954179","issue_url":"https://api.github.com/repos/Engelberg/ubergraph/issues/12","id":166954179,"user":{"login":"Engelberg","id":138571,"avatar_url":"https://avatars.githubusercontent.com/u/138571?v=3","gravatar_id":"","url":"https://api.github.com/users/Engelberg","html_url":"https://github.com/Engelberg","followers_url":"https://api.github.com/users/Engelberg/followers","following_url":"https://api.github.com/users/Engelberg/following{/other_user}","gists_url":"https://api.github.com/users/Engelberg/gists{/gist_id}","starred_url":"https://api.github.com/users/Engelberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Engelberg/subscriptions","organizations_url":"https://api.github.com/users/Engelberg/orgs","repos_url":"https://api.github.com/users/Engelberg/repos","events_url":"https://api.github.com/users/Engelberg/events{/privacy}","received_events_url":"https://api.github.com/users/Engelberg/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T17:44:57Z","updated_at":"2015-12-23T17:44:57Z","body":"After thinking about this more and discussing with others, I have come to the conclusion that you are right that (graph [1 2]) should evaluate as equal to (graph [2 1]).  I will be making this change soon."}}