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