We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 307fe68 commit a05c081Copy full SHA for a05c081
.gitignore
@@ -1,2 +1,3 @@
1
Manifest.toml
2
docs/build/
3
+.vscode/settings.json
src/graphs.jl
@@ -48,10 +48,12 @@ end
48
49
Add a vertex to MetaGraph `g` with label `label` having value `val`.
50
51
-Return true if the vertex has been added, false otherwise.
+Return true if the vertex has been added, false incase the label already exists or edge was not added.
52
"""
53
function add_vertex!(g::MetaGraph, label, val)
54
added = add_vertex!(g.graph)
55
+ if g.haskey(label)
56
+ return false
57
if added
58
v = nv(g)
59
g.vprops[label] = (v, val)
0 commit comments