Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph Snapshot Feature: Store & Retrieve Graph History #600

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

Susmita331
Copy link

This PR introduces timestamped graph snapshots, allowing users to store, retrieve, and track historical graph states for debugging, fraud detection, and network analysis.

Instead of relying on cached data (pycache), this implementation ensures explicit snapshot storage, making graph versioning deterministic and retrievable across sessions.
##Key Features

Snapshot Storage & Retrieval
Saves graph states with real-time timestamps (add_snapshot()).
Restores a past state with get_snapshot(timestamp).
Lists all stored timestamps via list_snapshots().
Why This Over pycache?
pycache is for Python bytecode compilation, not structured historical tracking.
This approach persists meaningful snapshots, independent of runtime cache invalidation.
Ensures predictable retrieval of graph states, even after code modifications.
Edge & Adjacency List Fixes
Ensures edge weights and relationships persist across snapshots.
Fixes deep-copy issues with GraphEdge.
Tests & Validation
Added test_snapshot_creation, test_snapshot_retrieval, and test_invalid_snapshot.
All tests pass successfully with pytest --cov=./.
##Documentation

Added timestamped_graph.md detailing:
Feature usage & API methods
Real-world applications
Future improvements (e.g., matrix support, optimized storage).

Susmita-Chakrabarty and others added 26 commits March 5, 2025 22:09
Implemented list_snapshots() and attached snapshot methods to Graph, ensuring timestamp-based snapshots across all graph types.
@Susmita331
Copy link
Author

@czgdp1807 @Kishan-Ved Please review the code and give feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants