8888 add_vertex!(meta_graph, label, data)
8989
9090Add 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.
9192
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.
9394"""
9495function Graphs. add_vertex! (meta_graph:: MetaGraph , label, data)
9596 if haskey (meta_graph, label)
@@ -106,10 +107,15 @@ function Graphs.add_vertex!(meta_graph::MetaGraph, label, data)
106107 return added
107108end
108109
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+
109114"""
110115 add_edge!(meta_graph, label_1, label_2, data)
111116
112117Add 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.
113119
114120Return `true` if the edge has been added, `false` otherwise.
115121"""
@@ -122,6 +128,12 @@ function Graphs.add_edge!(meta_graph::MetaGraph, label_1, label_2, data)
122128 return added
123129end
124130
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+
125137# # Remove vertex
126138
127139function _rem_vertex! (meta_graph:: MetaGraph , label, code)
0 commit comments