You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove specified nodes, and their associated edges, from a GNNGraph. This operation reindexes the remaining nodes to maintain a continuous sequence of node indices, starting from 1. Similarly, edges are reindexed to account for the removal of edges connected to the removed nodes.
195
+
196
+
# Arguments
197
+
- `g`: The input graph from which nodes (and their edges) will be removed.
198
+
- `nodes_to_remove`: Vector of node indices to be removed.
199
+
200
+
# Returns
201
+
A new GNNGraph with the specified nodes and all edges associated with these nodes removed.
202
+
203
+
# Example
204
+
```julia
205
+
using GraphNeuralNetworks
206
+
207
+
g = GNNGraph([1, 1, 2, 2, 3], [2, 3, 1, 3, 1])
208
+
209
+
# Remove nodes with indices 2 and 3, for example
210
+
g_new = remove_nodes(g, [2, 3])
211
+
212
+
# g_new now does not contain nodes 2 and 3, and any edges that were connected to these nodes.
0 commit comments