If label_vertex is the only method supplied, I would expect it to overwrite the labels, but it does not. It always adds a new label even if the label already exists. The most correct fix in my opinion is to update label_vertex to simply set the labels for a vertex to the ones passed in, but that may break existing code, so the next best solution may be to add a remove_vertex_labels that would remove all labels for a given vertex. Would you be willing to accept a pull request for either of these approaches and if so, do you have a preference for one over the other?
There does not seem to be a way to remove/reset/overwrite vertex labels. The only method that appears to be an option is
Graph.label_vertex
.If
label_vertex
is the only method supplied, I would expect it to overwrite the labels, but it does not. It always adds a new label even if the label already exists. The most correct fix in my opinion is to updatelabel_vertex
to simply set the labels for a vertex to the ones passed in, but that may break existing code, so the next best solution may be to add aremove_vertex_labels
that would remove all labels for a given vertex. Would you be willing to accept a pull request for either of these approaches and if so, do you have a preference for one over the other?Update the behavior of
Graph.label_vertex
:Add a new method (
Graph.remove_vertex_labels
):