Class to make a snapshot of the graph and restore it later.
The newly added nodes and edges can be removed using the restore() function.
- Note
- After a state is restored, you cannot restore a later state, i.e. you cannot add the removed nodes and edges again using another Snapshot instance.
- Warning
- Node and edge deletions and other modifications (e.g. changing the end-nodes of edges or contracting nodes) cannot be restored. These events invalidate the snapshot. However, the edges and nodes that were added to the graph after making the current snapshot can be removed without invalidating it.