buhito is a Python library for enumerating graphlets and analyzing graphlet-based features from graphs.
git clone https://github.com/lanl/buhito.git
cd buhito
pip install -e .git clone https://github.com/lanl/buhito.git
cd buhitoif creating a new conda environment:
conda env create -n buhito --file env.ymlif installing into an existing conda environment:
conda env update -n <ENV_NAME> -f env.ymlpip install -e .import networkx as nx
from buhito import generate_subgraphs_breadthwise
G = nx.petersen_graph()
nx.set_node_attributes(G, {n: "C" for n in G.nodes}, "atom_key")
nx.set_edge_attributes(G, {e: "1" for e in G.edges}, "bond_key")
fp, bitinfo = generate_subgraphs_breadthwise(
G,
depth=4,
return_nodewise=False,
full_hash=True,
node_key="atom_key",
edge_key="bond_key"
)
print("Graphlet fingerprint length:", len(fp))from buhito import generate_subgraphs_depthwise
subsets, counts = generate_subgraphs_depthwise(G, maxlen=4)
print("Found graphlet subsets:", len(subsets))Available example scripts:
examples/plotting_example.py— visualize graphlets from the Petersen graphexamples/qm9/benchmark_graphlet_featurizers_train_test.py— benchmark featurizers on QM9 chemical properties dataexamples/reddit_example/reddit_graphlets_example.py— network graphlet analysis for REDDIT-5K graphs
pytest tests/src/buhito/— core featuressrc/buhito/converters.py— converters to NetworkX graphssrc/buhito/plotting.py— graphlet visualization helpers
- Yulia Pimonova (LANL)
- Nicholas Lubbers (LANL)
- Nathan Lemons (LANL)
- Pieter Swart (LANL)
If you use buhito in your work, please cite this repository. A publication citation is coming.
buhito is released under the BSD-3 License. See LICENSE.txt for the full license.
The copyright to buhito is owned by Triad National Security, LLC
and is released for open source use as project number O5043.
© 2026. Triad National Security, LLC. All rights reserved. This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. All rights in the program are. reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration. The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare. derivative works, distribute copies to the public, perform publicly and display publicly, and to permit. others to do so.