Skip to main content

subgraphsearch

CI PyPI crates.io: subgraphsearch crates.io: subgraphsearch-core

Find induced cycles, paths, trees and cliques in a graph, or any induced subgraph with a given number of vertices and edges. Searches are fast, reproducible from a seed and come with diagnostics for tuning them. Many graph formats are supported.

A search can be required to fix particular vertices. It can also find regular subgraphs with a prescribed degree and subgraphs with a given total weight in weighted graphs. Graphs can be built from block designs and other incidence structures, as well as switched with respect to the subgraphs a search finds. Near misses are reported in addition to exact solutions, enabling use as an approximation algorithm.

See the quickstart notebook for a complete tour.

One random graph with 36 vertices and 156 edges, searched four times and drawn with viz.plot_graph: an induced 12-cycle, an induced path on 15 vertices, an induced tree on 16 vertices and a 5-clique, each drawn in its own shape with the rest of the graph around it

Install

subgraphsearch is on PyPI and requires Python 3.10 or later and NumPy 1.24 or later. With uv:

uv add subgraphsearch                # add the package to your project
uv add "subgraphsearch[all]"         # also plotting and conversions to networkx, igraph and SciPy
uv tool install subgraphsearch       # just the `subgraphsearch` command, on your PATH
uvx subgraphsearch info g.g6         # or run the command without installing it

With pip:

pip install subgraphsearch           # the package and the `subgraphsearch` command
pip install "subgraphsearch[all]"    # also plotting and conversions to networkx, igraph and SciPy
pipx install subgraphsearch          # just the command, in its own environment
pipx run subgraphsearch info g.g6    # or run the command without installing it

Prebuilt wheels cover Linux (including Alpine), macOS and Windows (including ARM), so installing needs no compiler.

To copy the quickstart notebook into the current directory and open it in JupyterLab:

uv run --with "subgraphsearch[all]" --with jupyterlab python -m subgraphsearch quickstart   # with uv
pip install "subgraphsearch[all]" jupyterlab && python -m subgraphsearch quickstart       # with pip

Python

import subgraphsearch as ss
from subgraphsearch import viz

g = ss.generate("exponential", 100, 0.6, seed=1)   # a random graph: 100 vertices, density 0.6

r = ss.search(g, size=11, edges=55)    # 11-cliques
r = ss.search(g, size=30, edges=340)   # 30 vertices spanning exactly 340 edges
r = ss.search(g, size=10, degree=4)    # 4-regular induced subgraphs

big = ss.largest(g, "clique")          # the largest clique the search finds; also "path", "cycle",
big.size, big.best.solutions()         # "tree" and "independent"; its size, and the cliques found
g.induced(big.best.best.vertices).is_clique()   # check: also is_path, is_cycle, is_tree, is_independent

print(r.summary())
r.solutions()                                         # the distinct vertex sets found
viz.plot_graph(g, highlight=r.best.vertices)          # draw it
viz.plot_search_summary(r)                            # how the search went
viz.plot_graph_summary(g, highlight=r.best.vertices)  # degrees, spectrum, adjacency matrix
viz.save_html("result.html", r)                       # interactive viewer; viz.show(r) in Jupyter

In Jupyter, graphs and results display as summaries with small charts.

  • What to search for: edges= (an exact edge count), degree= (a regular subgraph), path=True (an induced path), or a total weight in a WeightedGraph. fixed= names vertices the subgraph must contain, connected=True requires a connected subgraph, and max_conflict in r.solutions(max_conflict=2) also returns near misses.
  • The largest: ss.largest(g, "path" | "cycle" | "tree" | "clique" | "independent") searches size after size and returns every search, by size: .size, .best (the search at that size) and .next (the closest failure above it, with its near misses).
  • Checking shapes: g.is_path(), is_cycle(), is_tree(), is_clique(), is_independent() and is_connected() say whether a graph is one; for a subgraph a search found, ask the graph it induces, g.induced(vertices).is_path().
  • Graphs: ss.Graph(n, edges), ss.read(path), g.write(path), g.complement(), g.induced(vs), g.switch(vs), g.common_neighborhood(vs), g.adjacency_matrix(), g.laplacian(), g.layout(), and from an incidence structure, ss.Graph.point_graph(blocks) and ss.Graph.block_graph(blocks).
  • Random graphs: ss.generate("exponential" | "power" | "geometric", n, density), ss.generate("exponential", n, mean_degree=3) for large sparse graphs, and ss.generate_weighted(n, mean_weight); standard graphs: ss.hypercube(d) and ss.grid(r, c).
  • Weighted graphs: ss.WeightedGraph(n, [(u, v, w), ...]), ss.WeightedGraph.read(path).
  • Many graphs per file: ss.read_all(path), ss.read(path, index=3), ss.write_all(path, graphs).
  • Other libraries: subgraphsearch.convert.{to,from}_{networkx,igraph,scipy,numpy}.
  • Tuning: ss.sweep(g, size, edges, "div_dur", [0, 4, 16]) with viz.plot_sweep.
  • Spectra: viz.laplacian_spectrum and viz.spectral_summary.
  • Designs and switching: ss.designs.FANO_PLANE, viz.plot_fano_plane(), and viz.plot_switchings(g, sets) to draw a graph switched with respect to each of several vertex sets.
  • Linear algebra: sets of vectors with prescribed inner products are cliques in a graph on the candidate vectors. examples/hadamard.py finds Hadamard matrices of orders 8, 12 and 16 this way, as cliques of pairwise orthogonal ±1 vectors, in a fraction of a second each.

Rust

The search, generators and formats are also a Rust library, subgraphsearch-core, which needs Rust 1.87 or later. Add it with cargo add subgraphsearch-core; its API is documented on docs.rs.

use subgraphsearch_core::{Graph, SearchParams, search};

// find induced 4-vertex paths (3 edges) in a 12-cycle
let g = Graph::from_edges(12, (0..12).map(|i| (i, (i + 1) % 12))).unwrap();
let result = search(&g, &SearchParams::new(4, 3)).unwrap();
let found = result.experiments.iter().find(|e| e.success).unwrap();
assert_eq!(g.induced_edge_count(&found.vertices), 3);

Command line

The subgraphsearch command comes with the Python package (see Install); with a Rust toolchain, cargo install subgraphsearch builds the same command from crates.io.

subgraphsearch generate exponential -n 100 -d 0.6 -s 1 -o g.g6    # a random graph
subgraphsearch search g.g6 -k 11 -m 55                            # 11-cliques
subgraphsearch search g.g6 -k 30 -m 340 --max-conflict 2          # also report near misses
subgraphsearch search g.g6 -k 10 --degree 4                       # 4-regular subgraphs
subgraphsearch search sparse.g6 -k 12 --degree 2 --connected      # induced 12-cycles
subgraphsearch search sparse.g6 -k 20 --path                      # induced 20-vertex paths
subgraphsearch search sparse.g6 -k 20 --path --endpoints 0,7      # the same, from vertex 0 to vertex 7
subgraphsearch largest sparse.g6 --shape path                     # the longest induced path it finds
subgraphsearch generate weighted -n 200 -d 0.65 -o w.mtx          # a weighted graph
subgraphsearch generate hypercube --dimension 7 -o q7.g6           # the 7-cube; also grid --rows 6 --cols 6
subgraphsearch search w.mtx --weighted -k 15 -m 140               # total weight 140
subgraphsearch search many.g6 --all -k 10 -m 30 -q                # every graph in a file

subgraphsearch info g.g6                                          # statistics
subgraphsearch convert g.g6 g.dot --highlight 3,17,42             # draw a subgraph with Graphviz
subgraphsearch op complement g.g6 gc.g6                           # complements, induced subgraphs, ...
subgraphsearch incidence blocks.txt --on blocks -o b.g6           # a graph from a block design

subgraphsearch search g.g6 -k 11 -m 55 --json result.json         # save the full results
python -m subgraphsearch explore g.g6 --result result.json        # explore them in an interactive page

subgraphsearch search exits with status 2 when nothing is found.

Option Meaning Default
-k, --vertices subgraph vertices required
-m, --edges subgraph edges (total weight, with --weighted) required, unless --degree
-d, --degree instead, a subgraph regular of this degree
--path instead, an induced path
--endpoints with --path, the two vertices the path runs between, e.g. 0,7 none
--connected require a connected subgraph off
--fixed vertices the subgraph must contain none
-n, --experiments independent restarts 40
--moves maximum moves per experiment 250
--div-freq, --div-dur make div-dur random moves at the start of every div-freq moves 250, 4
-s, --seed random seed 1
--weighted read edge weights; -m is then a total weight off

How the search works

The subgraph induced by a set of vertices consists of those vertices and every edge of the graph between them, so choosing the vertices determines the edges. A clique is a set of vertices that are all adjacent, an independent set one with no edges at all, and a graph is d-regular when every vertex has exactly d neighbors.

Finding a k-vertex induced subgraph with exactly m edges is NP-hard (it includes finding cliques), so subgraphsearch uses a randomized local search, specifically a tabu search: a local search that forbids undoing recent moves for a while, so that it keeps exploring instead of cycling. It cannot prove that no solution exists, but in practice it finds solutions quickly when they are not too rare.

Moves

Write S for the current set of k vertices, e for the number of edges they induce, and d_S(v) for the number of neighbors a vertex v has in S. The search minimizes the conflict |e - m|; a conflict of 0 is a solution. Each move swaps one vertex u of S for one outside vertex w. Keeping d_S(v) up to date for every vertex makes each swap cheap to evaluate: the edge count becomes e - d_S(u) + d_S(w) - [u ~ w], where [u ~ w] is 1 if u and w are adjacent and 0 otherwise. Removing u loses its d_S(u) edges and adding w gains its d_S(w), but an edge between them is counted in d_S(w) and leaves with u. The search takes one of the best swaps at random.

Two refinements make this fast and effective:

  • Restricted neighborhood. If the last move left the edge count unchanged, only swaps involving a vertex adjacent to exactly one of the two vertices just swapped are examined. Every other swap has the same value it had before the move, so the search concentrates on the swaps the move changed. This improves results as well as speed, and on large dense graphs it skips most of the work.
  • Tabu moves. The two vertices just swapped are tabu for the next move: the vertex just added cannot be removed and the vertex just removed cannot be added back. Without this the search would often cycle between the same two subgraphs. Moves stay tabu for a single step, the shortest possible tabu tenure.

Diversification and restarts

Local search gets stuck in local minima. To shake it loose, the first --div-dur moves of every --div-freq moves are made at random; these perturbations can improve the results considerably (--div-dur 0 turns them off). Each experiment is an independent restart from random vertices. Experiments run in parallel on all cores, and results still depend only on the seed.

Reading the results

Each experiment reports the best conflict it reached and the moves it needed:

  • Success rate and moves to success show how hard a target is; viz.plot_search_summary plots both, and the next section explains how to use them to tune a search.
  • Relative cost is the mean number of moves per success, over successful experiments; true cost divides all moves made by the number of successes, so it also counts failures.
  • Average conflict is the mean best conflict. Near misses are useful in their own right: with --max-conflict n the search doubles as an approximation algorithm, returning subgraphs within n edges of the target.

Variants

  • Weighted graphs (--weighted): edges carry integer weights and the target is a total weight. With all weights 1 it behaves like the plain search.
  • Regular subgraphs (--degree d): the conflict becomes the total deviation from regularity, Σ_{v∈S} |d_S(v) - d|. Each vertex's neighbor list is kept partitioned, subgraph neighbors first, so that swaps stay cheap to evaluate. The intended use is finding regular subgraphs of strongly regular graphs. A graph is strongly regular with parameters (n, k, λ, μ) when it has n vertices, is k-regular, every two adjacent vertices have exactly λ common neighbors, and every two non-adjacent vertices exactly μ; the 5-cycle, the Petersen graph and the Paley graphs are examples. Seidel switching a graph with respect to a vertex set S swaps edges and non-edges between S and the rest of the graph, leaving edges within S and within the rest unchanged. Switching a strongly regular graph with respect to a suitable regular subgraph can give another strongly regular graph with the same parameters, sometimes one not isomorphic to the original: switching the 4×4 rook's graph, (16, 6, 2, 2), with respect to a 2-regular subgraph on 8 vertices gives the Shrikhande graph. The search can find cliques and independent sets too, but the plain search does that much faster.
  • Two phases (--degree d --two-phase): first find a subgraph with the right number of edges (kd/2), then make it regular using only swaps that keep the edge count. It usually finds regular subgraphs about 1.5 to 3.5 times faster than --degree alone. With --fixed, it computes the edge target from the non-fixed vertices only, so it rarely succeeds; use --degree alone there.
  • Aspiration (--aspiration, edge-count and weight searches only): the tabu search's aspiration criterion, which lifts the tabu on a move that would beat the best conflict so far. After each move it also considers the swaps involving the two vertices just swapped, and takes one of them whenever it would. It can help a search that stalls, but usually makes little difference.
  • Connected subgraphs (--connected, any search): each component of the subgraph beyond the first adds 1 to the conflict, so only connected subgraphs that hit the target count as successes. Swaps are still chosen by the target alone. A disconnected subgraph that hits it leaves the search on a plateau, which it crosses by swaps that keep the target until it reaches a connected one, so this works best when connected subgraphs are common among those that hit the target. It has two main uses. --degree 2 --connected finds induced cycles rather than unions of them: on a 60-vertex random graph of density 0.08, all 200 of 200 experiments find a single 12-cycle, where --degree 2 alone ends on one in 110. And -k k -m k-1 --connected finds induced trees, since a connected graph on k vertices with k - 1 edges is a tree: on the same graph it finds 10-vertex trees in all 200 experiments, where the edge count alone gives a tree in 25. The two-phase search's second phase makes no random moves, so it crosses such plateaus less often; leave out --two-phase here. Counting components after every move costs little in sparse graphs but can double the time in dense ones, whose dense subgraphs are connected anyway, so use it only where disconnected solutions turn up.
  • Paths (--path, path=True): induced paths on k vertices. A path is a tree, but the tree search rarely ends on one beyond a few vertices, so paths have a search of their own. It makes the regular search's moves for degree 2, but values each swap by how far the deviation from regularity would be from 2 rather than 0, since a path's two endpoints have degree 1 and every other vertex degree 2, plus how far the edge count would be from k - 1. The conflict is |deviation - 2| + |edges - (k - 1)| plus the components beyond the first, which is 0 exactly for an induced path. On the 60-vertex graph above it finds paths of 29 vertices, longer than the graph's longest induced cycle, and in hypercubes it reaches the known snake-in-the-box records up to the 8-cube's 99 vertices. In the 9-cube, the lowest dimension where the longest snake is unknown, it finds snakes of 185 vertices in under three minutes, 7 short of the record of 192 vertices (191 edges, reported in 2026; the previous record, 191 vertices, had stood since 2012); see Performance. Fixing a 95-vertex snake of the 8-cube in one half of the 9-cube with fixed= gets closer: the search for the rest then finds snakes of 189 vertices in most experiments, 3 short of the record, though only some 8-cube snakes work as the half (examples/snake_9cube.py). Like regular searches, it needs an unweighted graph.
  • Paths between two vertices (--endpoints s,t, endpoints=(s, t), with a path search): induced paths that run from s to t. The shortest path between two vertices is always induced and easy to find, but long induced paths between them are as hard to find as long induced paths in general. The search attaches a new vertex to each of s and t, which an induced path can only contain as an end, and looks for a path two vertices longer that contains all four; the results leave the new vertices out, so every subgraph returned, near misses included, contains s and t. Between opposite corners of the 7-cube it finds paths of 48 vertices in 140 of 200 experiments, in under a second.

Random graphs and operations

  • exponential: Erdős–Rényi; each pair of vertices is an edge independently with probability equal to the density. With --mean-degree d (mean_degree=d) instead of a density, the probability is d / (n - 1) for any d, and the graph is generated in time proportional to its edges rather than to the pairs of vertices: 100,000 vertices with 3 neighbors each take 0.2 s. Densities, in steps of 0.001, cannot make such sparse graphs.
  • geometric: a random geometric graph: random points in the unit square, joined when within a distance chosen so that the disc around a point covers a fraction of the square equal to the density. There is no wrap-around, so vertices near the edges have fewer neighbors and the actual density is lower.
  • power: each vertex is joined to the same number of randomly chosen higher-numbered vertices. Degrees spread more widely than in exponential graphs but have no heavy tail, so despite the name these are not scale-free graphs. Power and geometric graphs only make sense for densities below about 0.5.
  • weighted: random pairs of vertices have their weight increased by 1 until the mean weight per pair is reached, so weights above 1 are common once it approaches 1.
  • hypercube (--dimension d, ss.hypercube(d)): the hypercube on the 2^d bit strings of length d, joined when they differ in one bit, up to 16 dimensions. Not random: the home of the snake-in-the-box and coil-in-the-box problems.
  • grid (--rows r --cols c, ss.grid(r, c)): the r by c grid, vertex ic + j in row i and column j.

Graph operations help focus a search. Searching the complement is equivalent, since k vertices with m edges become k vertices with k(k-1)/2 - m, and for a dense graph the complement is sparse and cheaper to work with. Inducing a subgraph on the common neighborhood of some vertices restricts the search to vertices adjacent to all of them, and switch performs Seidel switching (see Variants) with respect to a vertex set, such as a regular subgraph found by the search.

Graphs can also be built from an incidence structure, a set of points with a family of subsets called blocks, such as a block design. Its point graph joins two points when exactly k blocks contain both, and its block graph joins two blocks when they share exactly k points (subgraphsearch incidence, with one block per line; ss.Graph.point_graph and ss.Graph.block_graph in Python). Many strongly regular graphs arise this way. The block graph of all pairs from 8 points is the triangular graph T(8), with parameters (28, 12, 6, 4), and switching it with respect to four disjoint pairs, an independent set the search finds, gives one of the Chang graphs: strongly regular with the same parameters, but not isomorphic to T(8).

Choosing a search and its settings

Goal Search
k vertices with exactly m edges -k k -m m (size=k, edges=m)
a k-clique, a k-vertex independent set -m set to k(k-1)/2, or to 0
the densest (or sparsest) k vertices raise (or lower) -m until successes stop; the threshold is sharp
subgraphs close to a target add --max-conflict n (r.solutions(max_conflict=n))
subgraphs containing given vertices --fixed, or for cliques, search their common neighborhood (below)
regular subgraphs of degree d --degree d --two-phase, or --degree d alone with --fixed
induced cycles on k vertices --degree 2 --connected (degree=2, connected=True)
induced paths on k vertices --path (path=True)
induced trees on k vertices -m set to k - 1, with --connected (edges=k-1, connected=True)
a total weight in a weighted graph --weighted -m w

Some reformulations make a search easier:

  • Restrict to a neighborhood. A subgraph whose vertices must all be adjacent to some vertices F (a clique through F, for example) lies in their common neighborhood. Searching g.induced(nbrs), with nbrs = g.common_neighborhood(F), for k - |F| vertices, instead of fixing F in the whole graph, is typically about 3 times faster for cliques through a given vertex. Vertex i of the result is nbrs[i] of the original graph.
  • Search the complement of a dense graph. k vertices with m edges become k vertices with k(k-1)/2 - m in the complement, which is sparse when the graph is dense.
  • Find the limit by bisection. To find the most edges k vertices can span, search a few values of m: the switch from always found to never found is abrupt (in a 100-vertex graph of density 0.6, for example, 30 vertices spanning 345 edges are easy to find and 350 are out of reach), and near-misses (--max-conflict) show how close a failed target came.
  • Let largest find the size. For the largest induced path, cycle or tree, clique or independent set, ss.largest (subgraphsearch largest --shape ...) does the searching: it doubles the size while searches succeed, then bisects between the last success and the first failure. Some sizes can be impossible below the largest (between two hypercube vertices that differ in an odd number of bits, every path has an even number of vertices), so a size counts as reachable if a search succeeds at it or at one of the next lookahead sizes, 2 by default. With endpoints, it starts at the shortest path between them. The size it finds is a lower bound, like any heuristic's; more experiments or moves can raise it.

Settings

Tune a search on your own graph by trying a few settings; ss.sweep runs one search per value of a setting, and viz.plot_sweep compares them. As a rule:

  • Spend the budget on experiments, not long runs. Most successful experiments succeed early, and an experiment that has stalled rarely recovers, so the defaults are many short runs: 40 experiments of up to 250 moves. When successes come quickly, runs of 50 to 250 moves can find solutions 4 to 17 times faster than runs of 1000. To tune this for your target, run a pilot search with generous --moves (say 5000), look at the moves successful experiments needed (the success-time distribution, or viz.plot_run_time_distribution), and set --moves to two or three times the median, using the rest of the time for more --experiments. Raise --moves if successes cluster near the limit; do not go far below the size of the subgraph, since a random start may need about k swaps to reach a solution.
  • Use more experiments to find more solutions. The success rate estimates how hard a target is, and more experiments find more distinct solutions, although many repeat (r.solutions() lists each once).
  • Leave diversification at its defaults. Short bursts of random moves make little difference. Bursts of k to 2k random moves help long runs that stall, because they act as restarts within an experiment, but shorter runs with more experiments do the same more simply. --div-dur 0 gives a pure local search.
  • Aspiration rarely makes a difference; try it on searches that stall.
  • Seeds: results depend only on the seed and the settings, not on the number of threads, so a search can be repeated exactly; change the seed for independent runs.

Performance

Wall-clock times on an Apple M3 Max laptop with 16 cores, using all of them, for searches started from Python (the command runs the same engine). Settings are given as experiments × maximum moves per experiment.

An experiment stops at its first solution, so the moves actually made, not the maximum, determine the time.

Search Settings Moves made Time Successes
11-cliques in a random graph on 100 vertices, density 0.6 40 × 250 (defaults) 1,652 0.4 ms 40 of 40
30 vertices spanning 346 edges in the same graph, near the limit 60 × 2000 81,539 14 ms 21 of 60
13-cliques in a random graph on 1,000 vertices, density 0.5 200 × 2000 12,042 12 ms 200 of 200
14-cliques in the same graph 200 × 2000 134,267 135 ms 182 of 200
15-cliques in the same graph 200 × 2000 396,104 394 ms 4 of 200
8-regular subgraphs on 20 vertices of the Paley graph on 61 vertices 100 × 2000, two phases 183,319 49 ms 11 of 100
15 vertices of total weight 140 in a weighted graph on 1,000 vertices 40 × 3000 634 1 ms 40 of 40
induced paths on 51 vertices in the 7-cube (the snake-in-the-box record) 400 × 2000 409,366 0.51 s 313 of 400
induced paths on 99 vertices in the 8-cube (the record) 400 × 20,000 7,951,718 21 s 3 of 400
induced paths on 180 vertices in the 9-cube (the record is 192) 100 × 200,000 13,226,544 110 s 44 of 100
induced paths on 185 vertices in the 9-cube 64 × 300,000 18,928,147 163 s 1 of 64
induced paths on 189 vertices in the 9-cube through a fixed 95-vertex snake in one half 64 × 200,000 4,256,688 36 s 62 of 64

A search that misses its target makes every move it is allowed, so its time is the cost of a move times the number of moves. The cost of a move grows in proportion to the number of vertices, and a little less than in proportion to the size of the subgraph.

Here are 40 × 250 = 10,000 moves looking for 30 vertices in random graphs of density 0.5:

Graph All 16 cores One thread
100 vertices 1.7 ms 20 ms
1,000 vertices 19 ms 230 ms
10,000 vertices (25 million edges) 210 ms 2.4 s

On 1,000 vertices, the same 10,000 moves take 14 ms for 20-vertex subgraphs and 61 ms for 100-vertex subgraphs. Experiments run in parallel, so on 16 cores a search is 11 to 12 times faster than on one thread (--threads 1). Once every core is busy, which 40 experiments already ensure here, the time grows in proportion to the total number of moves: 160 experiments take four times as long.

A graph on 10,000 vertices with 25 million edges takes about 330 MB of memory. Generating it takes 0.24 s, writing it as graph6 0.05 s, and reading it back 0.28 s.

Regular, cycle and path searches keep, in every thread, where each vertex's neighbors are in its neighbor list. On graphs of up to 2,048 vertices they use a table with an entry for every pair of vertices, as the original programs do; on larger ones, an entry for every edge, so their memory grows with the number of edges rather than with the square of the number of vertices. A path search on all 16 cores in a random graph on 32,000 vertices with 3 edges per vertex peaks at 0.24 GB. These searches support graphs of up to 32,767 vertices.

Graph formats

Format Name Extensions Read Write Use
graph6 graph6 .g6 ✓ ✓ dense or medium graphs; the default
sparse6 sparse6 .s6 ✓ ✓ sparse graphs
Matrix Market mtx .mtx ✓ ✓ SciPy, MATLAB, Julia; edge weights
edge list edgelist .edges, .csv, .tsv ✓ ✓ anything; edge weights
Graphviz dot .dot, .gv ✓ drawing, with a highlighted subgraph
GraphML graphml .graphml ✓ Gephi, Cytoscape, yEd
adjacency lists lists, wlists .txt (lists) ✓ ✓ plain text, one line of neighbors per vertex

graph6 is the most compact format for dense graphs and sparse6 for sparse ones; both are standard in combinatorics (nauty, SageMath, networkx, House of Graphs). They can also hold many graphs, one per line: subgraphsearch info lists them, search --all searches each one, and --index N picks one. Edge lists keep isolated vertices with a # vertices: N header.

Edge weights (integers from 1 to 255) are an edge list's third column or a Matrix Market file's values. Formats without weights read as weight 1, and writing a weighted graph to one is an error.

Development

See DEVELOPMENT.md for setting up, testing, the scripts and releasing.

Porting notes

subgraphsearch is a port of an earlier set of C programs. See PORTING.md for how they map onto it, how to reproduce their runs exactly and how the port is tested against them.

License

MIT

Metadata

Release files for subgraphsearch 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subgraphsearch 1.5.0
File Size Uploaded Provenance Actions
subgraphsearch-1.5.0.tar.gz 147.7 kB With provenance Details for subgraphsearch-1.5.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for subgraphsearch 1.5.0
File Actions
subgraphsearch-1.5.0-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for subgraphsearch-1.5.0-cp310-abi3-win_arm64.whl
subgraphsearch-1.5.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for subgraphsearch-1.5.0-cp310-abi3-win_amd64.whl
subgraphsearch-1.5.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for subgraphsearch-1.5.0-cp310-abi3-musllinux_1_2_x86_64.whl
subgraphsearch-1.5.0-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for subgraphsearch-1.5.0-cp310-abi3-musllinux_1_2_aarch64.whl
subgraphsearch-1.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for subgraphsearch-1.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
subgraphsearch-1.5.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for subgraphsearch-1.5.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
subgraphsearch-1.5.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for subgraphsearch-1.5.0-cp310-abi3-macosx_11_0_arm64.whl
subgraphsearch-1.5.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for subgraphsearch-1.5.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 8.6 MB

Release files / subgraphsearch-1.5.0.tar.gz

Download URL subgraphsearch-1.5.0.tar.gz
Size 147.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4231c7fa60ac6aadc01b40d78b2126285965a24d1eab7588f64d1b440f81f31c
BLAKE2b-256 checksum
How to use checksums
29034b7fc7376dad7474ed4cb258a11778540559b18bca93c852f61df41c03e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / subgraphsearch-1.5.0-cp310-abi3-win_arm64.whl

Download URL subgraphsearch-1.5.0-cp310-abi3-win_arm64.whl
Size 902.7 kB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
6b668dd7526f3b8cd057ea2674b134c8475f7f068c1a794848e53b511fcdf9e5
BLAKE2b-256 checksum
How to use checksums
9c23a0219eb49ffb04d0739815c8ffaa7ee10ec8425844d147d814bb1fad00e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / subgraphsearch-1.5.0-cp310-abi3-win_amd64.whl

Download URL subgraphsearch-1.5.0-cp310-abi3-win_amd64.whl
Size 959.5 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
de185bc40f1624a0c85200c94b66f0e42e062849ab21d6e9f724274f3166b00d
BLAKE2b-256 checksum
How to use checksums
a44cfccbd8a241961e38376914b6c1dd0d69219025e9ecf1a8aae3c92e3a8385
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / subgraphsearch-1.5.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL subgraphsearch-1.5.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
01c4fef731548cf9f234ee1f730e989eead9f66d194b0b634cc2f77a54d264e3
BLAKE2b-256 checksum
How to use checksums
ffbf0b3f12029c60953b58bdf80cafb292aa4c392db4c9ea77e2ab6b45382620
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / subgraphsearch-1.5.0-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL subgraphsearch-1.5.0-cp310-abi3-musllinux_1_2_aarch64.whl
Size 1.2 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
0bf4f7665f35ecbeb1a88ed6e4b045951cc3986a5194e204b2db0157dcc044d6
BLAKE2b-256 checksum
How to use checksums
fd2701368686f2ed460169c8e7161e13cd068e881cab00b43932127d714a3330
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / subgraphsearch-1.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL subgraphsearch-1.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a37c619fbf6e32612aa5a89a9fc99b143a710212626316d7f834612650743b3b
BLAKE2b-256 checksum
How to use checksums
caeb2df32a3a088192403eb1cf7bfd350d33a50d1277060cdfdf1cb3ec5265cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / subgraphsearch-1.5.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL subgraphsearch-1.5.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.0 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2b92f8f0f1672af54dc40edb5b095cd039cb9004cd9b3ab1dd3781027a4eac73
BLAKE2b-256 checksum
How to use checksums
a072e3d685f18fe737a4826c38899e6ed392b3ab24dd461f9875461308fff5d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / subgraphsearch-1.5.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL subgraphsearch-1.5.0-cp310-abi3-macosx_11_0_arm64.whl
Size 978.6 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
576610c740280df08e39a9954346b18362b803f5eab8f0c34e178a8e6569b3ad
BLAKE2b-256 checksum
How to use checksums
e19881b1be5a9366e653205a239ccf0daf5c51b6e8dddee4f3bbf56b91a0d175
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / subgraphsearch-1.5.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL subgraphsearch-1.5.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1154a97153b18a338dc4088db3f953a4b21257a8864713a047ee24dd2399b647
BLAKE2b-256 checksum
How to use checksums
c5630a93e972a0099f2b9d1e4f816264b5bf251ee5468cbc9acab6b4ffa1ff2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for subgraphsearch 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for subgraphsearch-1.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.5.0 This release

9 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page