Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect behavior when attempting to add multiedges to a non-multigraph. #11

Closed
sergeny opened this issue Dec 12, 2015 · 2 comments
Closed

Comments

@sergeny
Copy link

sergeny commented Dec 12, 2015

Bug: a nil edge attribute appears from nowhere when attempting to add parallel edges to a non-multi-undirected graph

(:attrs (ubergraph/add-edges (ubergraph/graph "a" "b") ["a" "b"] ["b" "a"]))
=>
{#ubergraph.core.UndirectedEdge{:id #uuid"6d53b586-265f-41f3-8462-4e7ebfaeac1e", :src "b", :dest "a", :mirror? true} nil}
@sergeny
Copy link
Author

sergeny commented Dec 12, 2015

Note that this is not even a correct way of recording the attribute: the uuid should be the key, not the entire edge object. Consider this:

(def G (ubergraph/add-edges (ubergraph/graph "a" "b") ["a" "b"] ["b" "a"]))
(ubergraph/attrs G "a" "b")
=> {}
(ubergraph/attrs G "b" "a")
=> {}
(ubergraph/attrs (ubergraph/set-attrs G ["a" "b"] {:some :attribute}) "a" "b")
=> {:some :attribute}
(:attrs (ubergraph/set-attrs G ["a" "b"] {:some :attribute}))
=>
{#ubergraph.core.UndirectedEdge{:id #uuid"06d9a4a9-9162-4837-86e1-5e88990e0075", :src "b", :dest "a", :mirror? true} nil,
 #uuid"06d9a4a9-9162-4837-86e1-5e88990e0075" {:some :attribute}}

@sergeny sergeny changed the title Bug: a nil edge attribute appears from nowhere when attempting to add parallel edges to a non-multi-undirected graph Incorrect behavior when attempting to add multiedges to a non-multigraph. Dec 12, 2015
@Engelberg
Copy link
Owner

Fixed in 0.1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants