
Hypergraph Database with Hypergraph Visualization.
Repo iMoonLab/Hypergraph-DB, read from GitHub 13 min ago. iMoonLab has not joined Take My Repo.
iMoonLab/Hypergraph-DB is a public repo on GitHub by iMoonLab. Hypergraph Database with Hypergraph Visualization. It declares the Apache-2.0 license on GitHub. It is written mainly in Python, has 93 stars and last changed on 2026-10-23. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-22.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
A Lightweight, Fast, and Modern Hypergraph Database with Hypergraph Visualization.
Features • Quick Start • Installation • Documentation • Examples
Hypergraph-DB is a lightweight, flexible, and high-performance Python library for modeling and managing hypergraphs — advanced graph structures where edges (hyperedges) can connect any number of vertices. Unlike traditional graphs that only support pairwise relationships, hypergraphs naturally represent complex multi-way relationships found in real-world scenarios.
Traditional graphs can only model pairwise relationships:
Alice ←→ Bob, Bob ←→ Charlie, Alice ←→ Charlie (3 separate edges)
Hypergraphs naturally model group relationships:
{Alice, Bob, Charlie} — working together on a project (1 hyperedge)
| Feature | Description |
|---|---|
| 🚀 High Performance | Handle millions of vertices and edges efficiently |
| 🔗 Native Hypergraph Support | True multi-way relationships, not decomposed binary edges |
| 💾 Persistence | Save/load with pickle, JSON, or custom formats |
| 🎨 Interactive Visualization | Built-in web-based visualization with D3.js |
| 🛠️ Admin Console | Web UI to browse, edit and manage your database |
| 🔍 Rich Queries | Neighbor queries, degree calculations, community detection |
| 📊 Flexible Attributes | Rich metadata for both vertices and hyperedges |
| 🛠️ Developer Friendly | Modern Python with type hints, comprehensive docs |
| ⚡ Modern Tooling | Built with uv, tested, and well-documented |
To demonstrate the performance of Hypergraph-DB, let’s consider an example:
This example demonstrates the efficiency of Hypergraph-DB, even when working with large-scale hypergraphs. Below is a detailed table showing how the performance scales as the size of the hypergraph increases.
Detailed Performance Results
The following table shows the results of stress tests performed on Hypergraph-DB with varying scales. The tests measure the time taken to add vertices, add hyperedges, and query vertices and hyperedges.
| Number of Vertices | Number of Hyperedges | Add Vertices (s) | Add Edges (s) | Query Vertices (s/queries) | Query Edges (s/queries) | Total Time (s) |
|---|---|---|---|---|---|---|
| 5,000 | 1,000 | 0.01 | 0.01 | 0.00/2,000 | 0.01/2,000 | 0.02 |
| 10,000 | 2,000 | 0.01 | 0.01 | 0.00/4,000 | 0.02/4,000 | 0.05 |
| 25,000 | 5,000 | 0.03 | 0.04 | 0.01/10,000 | 0.05/10,000 | 0.13 |
| 50,000 | 10,000 | 0.06 | 0.07 | 0.02/20,000 | 0.12/20,000 | 0.26 |
| 100,000 | 20,000 | 0.12 | 0.17 | 0.04/40,000 | 0.24/40,000 | 0.58 |
| 250,000 | 50,000 | 0.35 | 0.40 | 0.11/100,000 | 0.61/100,000 | 1.47 |
| 500,000 | 100,000 | 0.85 | 1.07 | 0.22/200,000 | 1.20/200,000 | 3.34 |
| 1,000,000 | 200,000 | 1.75 | 1.82 | 0.51/400,000 | 2.52/400,000 | 6.60 |
Key Observations:
Scalability:
Hypergraph-DB scales efficiently with the number of vertices and hyperedges. The time to add vertices and hyperedges grows linearly with the size of the hypergraph.
Query Performance:
Querying vertices and hyperedges remains fast, even for large-scale hypergraphs. For instance:
Total Time:
The total time to construct and query a hypergraph with 1,000,000 vertices and 200,000 hyperedges is only 6.60 seconds, showcasing the overall efficiency of Hypergraph-DB.
This performance makes Hypergraph-DB a great choice for applications requiring fast and scalable hypergraph data management.
| 🏗️ Feature | 📖 Description |
|---|---|
| 🎯 Flexible Structure | Support for complex hypergraphs with vertices and multi-way connections |
| ⚡ High Performance | Linear scaling with optimized operations for large datasets |
| 🎨 Interactive Viz | Beautiful web-based visualization with real-time interaction |
| 🛠️ Admin Console | Browse, search, edit and manage the database from your browser |
| 💾 Persistent Storage | Efficient save/load with data integrity guarantees |
| 🔍 Smart Queries | Fast neighbor discovery and relationship exploration |
| 🛠️ Developer Friendly | Modern Python with type hints and comprehensive documentation |
uv is the fastest Python package manager - 10-100x faster than pip!
# Install uv (one-time setup)
curl -LsSf https://astral.sh/uv/install.sh | sh # macOS/Linux
# or: powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
# Install Hypergraph-DB
uv pip install hypergraph-db
pip install hypergraph-db
# Clone the repository
git clone https://github.com/iMoonLab/Hypergraph-DB.git
cd Hypergraph-DB
# Quick setup with uv
uv sync
# Or with traditional tools
pip install -e ".[dev]"
Once you have the project set up, use these convenient commands:
| 🛠️ Command | Windows | Unix/Linux/macOS |
|---|---|---|
| Install dev deps | dev.bat install-dev |
make install-dev |
| Run tests | dev.bat test |
make test |
| Format code | dev.bat format |
make format |
| Build docs | dev.bat docs |
make docs |
Ready to build hypergraphs? Here's how to get started with Hypergraph-DB!
from hyperdb import HypergraphDB
# Initialize the hypergraph
hg = HypergraphDB()
# Add vertices
hg.add_v(1, {"name": "Alice", "age": 30, "city": "New York"})
hg.add_v(2, {"name": "Bob", "age": 24, "city": "Los Angeles"})
hg.add_v(3, {"name": "Charlie", "age": 28, "city": "Chicago"})
hg.add_v(4, {"name": "David", "age": 35, "city": "Miami"})
hg.add_v(5, {"name": "Eve", "age": 22, "city": "Seattle"})
hg.add_v(6, {"name": "Frank", "age": 29, "city": "Houston"})
hg.add_v(7, {"name": "Grace", "age": 31, "city": "Phoenix"})
hg.add_v(8, {"name": "Heidi", "age": 27, "city": "San Francisco"})
hg.add_v(9, {"name": "Ivan", "age": 23, "city": "Denver"})
hg.add_v(10, {"name": "Judy", "age": 26, "city": "Boston"})
# Add hyperedges
hg.add_e((1, 2, 3), {"type": "friendship", "duration": "5 years"})
hg.add_e((1, 4), {"type": "mentorship", "topic": "career advice"})
hg.add_e((2, 5, 6), {"type": "collaboration", "project": "AI Research"})
hg.add_e((4, 5, 7, 9), {"type": "team", "goal": "community service"})
hg.add_e((3, 8), {"type": "partnership", "status": "ongoing"})
hg.add_e((9, 10), {"type": "neighbors", "relationship": "friendly"})
hg.add_e((1, 2, 3, 7), {"type": "collaboration", "field": "music"})
hg.add_e((2, 6, 9), {"type": "classmates", "course": "Data Science"})
# Get all vertices and hyperedges
print(hg.all_v) # Output: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
print(hg.all_e) # Output: {(4, 5, 7, 9), (9, 10), (3, 8), (1, 2, 3), (2, 6, 9), (1, 4), (1, 2, 3, 7), (2, 5, 6)}
# Query a specific vertex
print(hg.v(1)) # Output: {'name': 'Alice', 'age': 30, 'city': 'New York'}
# Query a specific hyperedge
print(hg.e((1, 2, 3))) # Output: {'type': 'friendship', 'duration': '5 years'}
# Update a vertex
hg.update_v(1, {"name": "Smith"})
print(hg.v(1)) # Output: {'name': 'Smith', 'age': 30, 'city': 'New York'}
# Remove a vertex
hg.remove_v(3)
print(hg.all_v) # Output: {1, 2, 4, 5, 6, 7, 8, 9, 10}
print(hg.all_e) # Output: {(4, 5, 7, 9), (9, 10), (1, 2, 7), (1, 2), (2, 6, 9), (1, 4), (2, 5, 6)}
# Remove a hyperedge
hg.remove_e((1, 4))
print(hg.all_e) # Output: {(4, 5, 7, 9), (9, 10), (1, 2, 7), (1, 2), (2, 6, 9), (2, 5, 6)}
# Get the degree of a vertex
print(hg.degree_v(1)) # Example Output: 2
# Get the degree of a hyperedge
print(hg.degree_e((2, 5, 6))) # Example Output: 3
# Get neighbors of a vertex
print(hg.nbr_v(1)) # Example Output: {2, 7}
hg.add_e((1, 4, 6), {"relation": "team"})
print(hg.nbr_v(1)) # Example Output: {2, 4, 6, 7}
# Get incident hyperedges of a vertex
print(hg.nbr_e_of_v(1)) # Example Output: {(1, 2, 7), (1, 2), (1, 4, 6)}
# Save the hypergraph to a file
hg.save("my_hypergraph.hgdb")
# Load the hypergraph from a file
hg2 = HypergraphDB(storage_file="my_hypergraph.hgdb")
print(hg2.all_v) # Output: {1, 2, 4, 5, 6, 7, 8, 9, 10}
print(hg2.all_e) # Output: {(4, 5, 7, 9), (9, 10), (1, 2, 7), (1, 2), (2, 6, 9), (1, 4, 6), (2, 5, 6)}
# Or save in HIF format
hg.save_as_hif("my_hypergraph.hif.json")
# Load the hypergraph from a HIF file
hg.load_from_hif("my_hypergraph.hif.json")
Explore your hypergraphs visually with the built-in web-based visualization tool:
# Launch interactive visualization
hg.draw()
✨ Visualization Features:
💡 Pro Tip: The visualization reflects your hypergraph's current state in real-time!

Interactive hypergraph visualization showing vertex relationships and properties
Manage your database from the browser with the built-in admin console:
hg.admin() # http://127.0.0.1:8900
✨ Admin Console Features:

Admin console overview of a 25K-vertex neurology knowledge hypergraph
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
Maintained by iMoon-Lab, Tsinghua University
📧 Contact: Yifan Feng
Made with ❤️ by Yifan Feng and Xizhe Yu
⭐ Star us on GitHub • 📖 Read the Docs • 🐛 Report Issues
iMoonLab/Hypergraph-DB is a public repo on GitHub by iMoonLab. Hypergraph Database with Hypergraph Visualization.
It declares the Apache-2.0 license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-10-23. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:

12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all

[ICML 2026] Official resources of "Graph-R1: Towards Agentic GraphRAG Framework via End-to-end Reinforcement Learning".

Implementation of "YOLOv13: Real-Time Object Detection with Hypergraph-Enhanced Adaptive Visual Perception".
A pytorch library for graph and hypergraph computation.

MeshNet: Mesh Neural Network for 3D Shape Representation (AAAI 2019)

"Hyper-RAG: Combating LLM Hallucinations using Hypergraph-Driven Retrieval-Augmented Generation" by Yifan Feng, Hao Hu, Shihui Ying, Xingliang Hou, Shiquan Liu, Mingyuan Yang, Junchang Li, Shaoyi Du, Nanning Zheng, Han Hu, and Yue Gao.

DHGNN source code for IJCAI19 paper: "Dynamic Hypergraph Neural Networks"
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/iMoonLab/Hypergraph-DBTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.