88
88
add_vertex!(meta_graph, label, data)
89
89
90
90
Add a vertex to MetaGraph `meta_graph` with label `label` having metadata `data`.
91
+ If the `VertexData` type of `meta_graph` is `Nothing`, `data` can be omitted.
91
92
92
- Return true if the vertex has been added, false incase the label already exists or vertex was not added.
93
+ Return true if the vertex has been added, false in case the label already exists or vertex was not added.
93
94
"""
94
95
function Graphs. add_vertex! (meta_graph:: MetaGraph , label, data)
95
96
if haskey (meta_graph, label)
@@ -106,10 +107,15 @@ function Graphs.add_vertex!(meta_graph::MetaGraph, label, data)
106
107
return added
107
108
end
108
109
110
+ function Graphs. add_vertex! (meta_graph:: MetaGraph{<:Any,<:Any,<:Any,Nothing} , label)
111
+ return Graphs. add_vertex! (meta_graph, label, nothing )
112
+ end
113
+
109
114
"""
110
115
add_edge!(meta_graph, label_1, label_2, data)
111
116
112
117
Add an edge `(label_1, label_2)` to MetaGraph `meta_graph` with metadata `data`.
118
+ If the `EdgeData` type of `meta_graph` is `Nothing`, `data` can be omitted.
113
119
114
120
Return `true` if the edge has been added, `false` otherwise.
115
121
"""
@@ -122,6 +128,12 @@ function Graphs.add_edge!(meta_graph::MetaGraph, label_1, label_2, data)
122
128
return added
123
129
end
124
130
131
+ function Graphs. add_edge! (
132
+ meta_graph:: MetaGraph{<:Any,<:Any,<:Any,<:Any,Nothing} , label_1, label_2
133
+ )
134
+ return Graphs. add_edge! (meta_graph, label_1, label_2, nothing )
135
+ end
136
+
125
137
# # Remove vertex
126
138
127
139
function _rem_vertex! (meta_graph:: MetaGraph , label, code)
0 commit comments