-
Notifications
You must be signed in to change notification settings - Fork 75
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
Enables vertices to have more than one label #4
Enables vertices to have more than one label #4
Conversation
0d47b62
to
9b83eb7
Compare
9b83eb7
to
c79b5c0
Compare
c79b5c0
to
74733e2
Compare
Hi @bitwalker. Any thoughts on this? :) |
Sorry for the delay, I promise this is next on my list! Hopefully review this weekend and go from there :) |
Can you rebase your changes on master? There are some changes in your PR that I've made on master, or that I would prefer not be in PRs (such as the version change), but other than that, it's pretty much ready to merge. Sorry for the long wait! |
74733e2
to
663b853
Compare
Ready @bitwalker ! :) |
Thanks! Since this is a breaking change, I'll release it as 1.0.0 sometime today. |
Implement Bellman-Ford pathfinding
I know it's possible to assign complex labels to vertices, like
[:foo, :bar]
, but it would be nice if the handling of multiple labels could be internal to the library, since in several use cases you don't know beforehand all the labels for vertices.This could work like this (modified and extended from doctests for
Graph.label_vertex/3
):You could also receive both single terms and lists in
Graph.label_vertex/3
:This implies 2 breaking changes:
s
added at the end of the originalGraph.vertex_label/2
.Graph.vertex_labels/2
always returns a list.I was careful not to break the .dot serialization (at least with the current tests), but maybe it is worth discussing including both the vertex name and labels in the generated .dot file.