惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
T
ThreatConnect
SecWiki News
SecWiki News
F
Future of Privacy Forum
AWS News Blog
AWS News Blog
C
Cisco Blogs
A
Arctic Wolf
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
V2EX
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
NISL@THU
NISL@THU
Microsoft Azure Blog
Microsoft Azure Blog
量子位
The Hacker News
The Hacker News
Stack Overflow Blog
Stack Overflow Blog
Security Latest
Security Latest
M
Microsoft Research Blog - Microsoft Research
Google Online Security Blog
Google Online Security Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
InfoQ
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Troy Hunt's Blog
F
Fox-IT International blog
S
Security @ Cisco Blogs
博客园 - 司徒正美
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Comments on: Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 最新话题
GbyAI
GbyAI
Project Zero
Project Zero
腾讯CDC
T
Tailwind CSS Blog

Hacker News: Show HN

Show HN: YourMemory, persistent memory layer with temporal reasoning for agents CloudPostOffice — Simplest way to send and receive messages UUTA — A calm notebook for showing up AI API Pricing Calculator — Compare Costs Across Providers GitHub - scosman/cursed_browser: True AI-Native Browser — a VLM reads the HTML and hallucinates the page. Linear Chess Show HN: Browser-based Glider Sim Next Train GitHub - xfoa/Impatience: A library for instrumentation of event-to-event latency over a network GitHub - bitomule/musts: The validation loop that stops AI coding agents from claiming work is done before it actually is. Feynman - AI research assistant SynapCores — the AI-native database GitHub - erikshelley/complete-family-tree-viewer: A webpage for viewing all of a person's family tree at once GitHub - Noumenon-ai/AutoMaxFix: Controlled AI repair loop. Audit → Reproduce → Patch → Test → Report. Safety boundaries most AI agents skip. GitHub - JosephRedfern/plonk: Python interpreter at your fingertips Open Satchel — A free local-first PDF editor. Show HN: Hackobar – One feed for AI news GitHub - ghostchat-dev/widget: ~10KB chat widget. Zero cookies. Zero tracking. Fully open source. tiltbump X posts as clean Markdown for LLMs Symbol Combos — Cute Symbols, Kaomoji & Aesthetic Emojis to Copy GitHub - SellswordSoftware/justbookmarks: A simple desktop bookmark manager that uses the Netscape Bookmark HTML format so you can keep one browser-independent source of truth. SailWP. WordPress without the weight. Show HN: Widget Cast – Video Widgets for iOS PhoneDiffusion App - App Store Show HN: NanoApps: Run custom homebrew apps on iPod nano 7th generation Breadboard Knockout GitHub - elixir-volt/volt: Elixir-native frontend build tool — dev server, HMR, and production builds for JavaScript, TypeScript, Vue SFCs, and CSS. No Node.js required. Show HN: GuideOS – A radar-first, off-grid navigation kernel for edge robotics State lives on disk, not in chat Show HN: My biggest solo-project: Game engine with its own programming language MarketChacha | Stock Trading Community for Real Market Discussion GitHub - dmitryAQA/playwright-bdr-template Kubernetes, explained — interactive walkthroughs Show HN: Proj – organize your coding projects with categories and one-key CD Show HN: I made a compiler/VM for untrusted scripts Show HN: Stumpy – StumbleUpon Re-Created Show HN: Reward Is Not Reinforcement Until Admitted GitHub - dominikhei/cardamon: Cardamon is a cleanup tool for Prometheus that collects unused metrics from Grafana and Prometheus and generates drop statements for them. GitHub - NavodPeiris/grizzlars: High-performance DataFrame library written in C++ with Python bindings. Peakedin - LinkedIn's finest moments, curated weekly Planetensuche GitHub - cnemri/awesome-gemini-omni: A curated list of awesome Google Gemini Omni prompt guides, interactive platforms, and creative showcases. Show HN: An open-source, interactive AI engineering syllabus (1,100 papers) Show HN: I Built a Debugging Challenge for the AI Coding Age HTML Deployer: 1-Click AI Code To Website Publisher - Chrome 应用商店 GitHub - alkait/WhatsKept: Searchable, agent-queryable WhatsApp history from an iOS backup — a single Go binary. Geomatic | Tiny Volt Show HN: SenseCollect – Web data extraction made simple GitHub - feers77/iasql: A new implementation of SQL for IA purposes, using postgresSQL and Karpathy wiki-llm as inspiration. Kubernetes Study Path — From kubectl to a Production Cluster GitHub - octelium/cordium: Open-source sandbox platform with identity-based secretless infrastructure access for developers and AI agents on Kubernetes Play Doom with friends in your browser. You decide when you receive ForwardPass! (experimental) GitHub - jacksonsolid/Bytery fx.leftium.com GitHub - skorotkiewicz/cadence: $$hi Small marker tracking for source files. GitHub - nikitph/yieldos Show HN: Live AI music sequencing agent SaveNeighbor | Local help from people you trust drea: podcast ad blocker App - App Store JS Crossword GitHub - jake-stewart/tuie: A rich, performant TUI library for Rust. GitHub - AlexWasHeree/NoteCast: Local note engine that uses LLM to build and evolve a knowledge graph stocks.sjer.red — long PC parts RocketGraph — Never look at logs again Show HN: Replacing a 3.4MB video with 40kb of GSAP Show HN: Lightweight, OpenSource, zero-dependency App tour & user onboarding SDK Treasury — Personal Finance App | AI Insights & Budgeting Show HN: MailMark – Cold email tool where you own your domain and mailboxes Voxxy: Voice to Text for your Mac Menu Bar Show HN: I built a TikTok style video debate app GitHub - acatovic/ai-game-studio: AI generation of 2d game assets such as spritesheets Assemblr GitHub - AlexMason/worldnotes: Extensible inline-markdown editor with wiki-style navigation Show HN: Brew-browser – A native macOS GUI for Homebrew GitHub - aloth/cred-1: CRED-1: An Open Multi-Signal Domain Credibility Dataset (2,672 domains) Show HN: TalkTimer, a micro-SaaS run by an AI agent team Trickster's Table invest-like - AI value-investing: best-tier consensus beat S&P 500 by +72.7% GitHub - kimjune01/swebench-verified: Reproducible recon/craft/audit agent pipeline for SWE-bench Verified. Official-graded, codex-attested, GPL-3.0. Run it yourself. GitHub - mupt-ai/context-drop: cli tool to make sharing context between remote agents dead easy Multiple Real Desktops for Windows GitHub - lionello/han64: Handling Chinese text on the Commodore 64 Show HN: Strudel – Generate commit messages via Apple's on-device LLM Show HN: Audiomass – a free, open-source multitrack audio editor for the web move-reminder The Front Page HtmlUnit – Welcome to HtmlUnit GitHub - kouhxp/textsnap: Snap any image, screenshot, or webpage into plaintext. No GPU. No cloud. One command. Show HN: Pro Health Ledger – An open-source, net-neutral reputation system iPhone 版“Today” - App Store LLMRequirements.com — Hardware for Local LLMs Show HN: Hookwarden – npx tool to find and fix webhook HMAC bugs (JS/TS/Py/PHP) Frello — A small revolt against bloated software Career tools for data professionals | Datamata Studios Show HN: Kanban CLI (A local-first, agent-first task manager for the terminal) Show HN: Fleet – Python supervisor for running coding agents in parallel TravElly | A travel diary app for kids
GitHub - yamafaktory/hypergraph: Hypergraph is a data structure library to create a directed hypergraph in which a hyperedge can join any number of vertices.
yamafaktory · 2026-05-26 · via Hacker News: Show HN

graph


GitHub Workflow Status Crates.io docs.rs

Hypergraph is a data structure library to generate directed hypergraphs.

A hypergraph is a generalization of a graph in which a hyperedge can join any number of vertices.

📣 Goal

This library aims at providing the necessary methods for modeling complex, multiway (non-pairwise) relational data found in complex networks. One of the main advantages of using a hypergraph model over a graph one is to provide a more flexible and natural framework to represent entities and their relationships (e.g. Alice uses some social network, shares some data to Bob, who shares it to Carol, etc).

🎁 Features

This library enables you to represent:

  • non-simple hypergraphs with two or more hyperedges containing the exact same set of vertices
  • self-loops — i.e., hyperedges containing vertices directed to themselves one or more times
  • unaries — i.e., hyperedges containing a unique vertex

And to compute:

  • Graph traversal: BFS, DFS, reachability, topological sort, random walks
  • Shortest paths: Dijkstra point-to-point and single-source
  • Structural analysis: strongly connected components, weakly connected components, all simple paths, subgraph extraction, cycle detection, connectivity, transitive closure
  • Filtered views: retain_vertices, retain_hyperedges
  • Graph projections: incidence matrix (dense and COO sparse), Laplacian, line graph, dual hypergraph
  • Analytics: PageRank, centrality scores (degree, closeness, betweenness), nestedness profile
  • Generic query interface: HypergraphQuery trait works over both Hypergraph and PersistentHypergraph

📐 API reference

Graph primitives

Available on both Hypergraph and PersistentHypergraph via the HypergraphQuery trait.

Method Description
count_vertices() / count_hyperedges() Number of elements
is_empty() Whether the graph has any vertices
vertex_indices() / hyperedge_indices() All stable indices
get_vertex_weight(idx) / get_hyperedge_weight(idx) Weight lookup by index
get_vertex_hyperedges(idx) Hyperedge indices that include a vertex
get_hyperedge_vertices(idx) Ordered vertex list of a hyperedge

Vertex and hyperedge lookups

Method Description
contains_vertex(weight) Whether any vertex has the given weight
get_vertex_index(weight) Indices of all vertices with the given weight
find_hyperedges_by_weight(weight) Indices of all hyperedges with the given weight
get_adjacent_vertices_from(v) Vertices directly reachable from v
get_adjacent_vertices_to(v) Vertices with a direct edge into v
get_full_adjacent_vertices_from(v) Neighbours from v paired with their connecting hyperedges
get_full_adjacent_vertices_to(v) Predecessors of v paired with their connecting hyperedges
get_full_vertex_hyperedges(v) Vertex lists of every hyperedge containing v
get_vertex_degree_in(v) / get_vertex_degree_out(v) In/out degree
get_hyperedges_intersections(edges) Shared vertices across multiple hyperedges
get_hyperedges_connecting(from, to) Hyperedges that contain a directed from→to pair
get_vertex_neighborhood(v) All co-members of v across every hyperedge it belongs to

Graph traversal

Method Description
get_bfs(from) Breadth-first traversal order from a vertex
get_dfs(from) Depth-first traversal order from a vertex
is_reachable(from, to) Whether to is reachable from from
get_all_paths(from, to) All simple paths between two vertices
topological_sort() Kahn's algorithm; returns an error on cycles
random_walk(from, steps, seed) Random walk of steps hops from a vertex

Shortest paths

Method Description
get_dijkstra_connections(from, to) Cheapest path with hyperedge trace
get_dijkstra_connections_with_cost(from, to) Same, plus the total cost
get_dijkstra_from(from) Cheapest cost to every reachable vertex

Structural analysis

Method Description
strongly_connected_components() Kosaraju's algorithm
connected_components() Weakly connected components
is_acyclic() Cycle detection
find_cut_vertices() Articulation points via iterative Tarjan DFS
subgraph(vertices) Induced subgraph over a vertex set
is_connected() Whether the hypergraph is connected (clique-expansion BFS)
get_transitive_closure() All directed reachability pairs (from, to)

Graph properties

Method Description
get_orphan_vertices() Vertices belonging to no hyperedge
get_orphan_hyperedges() Hyperedges with an empty vertex list
get_endpoints() (sources, sinks) — in-degree 0 / out-degree 0
get_inclusions() All proper subset/superset pairs of hyperedges
is_k_uniform(k) Whether every hyperedge has exactly k vertices
get_core(min_degree, min_size) k-core decomposition via iterative peeling
get_nestedness_profile() Per-size inclusion statistics as Vec<NestednessEntry>

Graph projections

Method Description
expand_to_graph() Directed graph from consecutive vertex pairs
expand_to_star() Bipartite vertex–hyperedge membership pairs
to_incidence_matrix() Dense vertex × hyperedge incidence matrix
to_incidence_matrix_coo() Sparse COO (row, col) pairs for the incidence matrix
to_laplacian(normalized) Clique-expansion Laplacian (raw or normalized)
get_line_graph() Pairs of hyperedges sharing at least one vertex
get_dual() Dual hypergraph: per-vertex sorted list of incident hyperedges

Analytics

Method Description
compute_page_rank(damping, iterations) Iterative PageRank power method
compute_centrality(v) Degree, closeness, and betweenness centrality for a vertex

Mutations (Hypergraph only)

Method Description
new() / with_capacity(n) Create an empty graph
add_vertex(weight) Add a vertex; returns its stable VertexIndex
add_hyperedge(vertices, weight) Add a hyperedge; returns its stable HyperedgeIndex
remove_vertex(idx) Remove a vertex and all hyperedges that contain it
remove_hyperedge(idx) Remove a hyperedge
update_vertex_weight(idx, weight) Replace a vertex's weight
update_hyperedge_weight(idx, weight) Replace a hyperedge's weight
update_hyperedge_vertices(idx, vertices) Replace a hyperedge's vertex list
retain_vertices(predicate) Remove vertices that fail the predicate
retain_hyperedges(predicate) Remove hyperedges that fail the predicate
contract_hyperedge_vertices(edge, merge, into) Contract a set of vertices to one
join_hyperedges(edges) Merge hyperedges into their union
reverse_hyperedge(edge) Reverse the vertex ordering of a hyperedge
clear_hyperedges() Remove all hyperedges, keeping vertices
clear() Remove everything
append_vertex_to_hyperedge(edge, vertex) Append a vertex to the end of a hyperedge
prepend_vertex_to_hyperedge(edge, vertex) Prepend a vertex to the start of a hyperedge
insert_vertex_into_hyperedge(edge, vertex, pos) Insert a vertex at a given position
delete_vertex_from_hyperedge(edge, vertex) Remove the first occurrence of a vertex from a hyperedge
split_hyperedge(edge, at, weight) Split a hyperedge at an index into two new hyperedges
split_vertex(vertex, edges, weight) Create a new vertex replacing vertex in specified hyperedges
merge_vertices(primary, secondaries, weight) Merge multiple vertices into one
get_k_skeleton(k) Subhypergraph of all hyperedges with at most k vertices (stable indices)
get_edge_induced_subhypergraph(edges) Subhypergraph induced by specified hyperedges (reassigned indices)

Iterators (Hypergraph only)

Method Description
iter() Borrowing iterator over (&HE, Vec<&V>) tuples
vertices_iter() Iterator over (VertexIndex, &V) pairs
hyperedges_iter() Iterator over (HyperedgeIndex, &HE) pairs
into_iter() Consuming iterator over (HE, Vec<V>) tuples

⚗️ Implementation

  • 100% safe Rust
  • Proper error handling
  • Stable indexes for each hyperedge and each vertex — identity is the index, not the weight; duplicate weights are allowed on both sides
  • Parallelism (with Rayon)
  • HypergraphQuery<V, HE> trait — implement 9 primitives to get all graph algorithms for free; use it for generic functions and trait objects that work with either backend
  • Optional serde support (features = ["serde"] in Cargo.toml)
  • Optional persistence support (features = ["persistence"] in Cargo.toml)

🛠️ Installation

Add this to your Cargo.toml (replace current_version with the latest version of the library):

[dependencies]
hypergraph = "current_version"

To enable disk-backed persistent graphs:

[dependencies]
hypergraph = { version = "current_version", features = ["persistence"] }

💾 Persistent graphs

The persistence feature unlocks PersistentHypergraph, a disk-backed variant built on an LSM-tree (via fjall) with an in-memory hot-data cache. It supports graphs that exceed available RAM and survives process restarts without any manual serialization step.

use std::sync::Arc;
use hypergraph::PersistentHypergraph;

// Opens the database directory, or creates it if it doesn't exist.
let g = Arc::new(PersistentHypergraph::<MyVertex, MyEdge>::open("/var/data/my-graph")?);

// All write methods take &self — share freely across threads.
let g2 = Arc::clone(&g);
std::thread::spawn(move || {
    g2.add_vertex(my_vertex)?;
    Ok(())
});

Vertex and hyperedge types must implement serde::Serialize + serde::DeserializeOwned in addition to the usual trait bounds.

A bounded LRU cache (via quick-cache) sits in front of the disk store, keeping hot vertex weights and hyperedges in memory. The default capacity is 10 000 entries per layer; use PersistentHypergraph::open_with_capacity to tune it for your workload.

⚡️ Usage

Please read the documentation to get started.