Advanced Search via API
Complete reference for querying the SMOL database
The /search endpoint supports comprehensive filtering by all graph properties.
Combine multiple parameters to find exactly the graphs you need.
All endpoints return JSON by default. Use Accept: text/html header or access via browser for HTML responses.
Basic Filters
n,n_min,n_max- Filter by number of vertices (exact or range)
m,m_min,m_max- Filter by number of edges (exact or range)
min_degree,max_degree- Filter by minimum or maximum degree
Examples:
/search?n=7 # All 7-vertex graphs
/search?n_min=6&n_max=8 # Graphs with 6, 7, or 8 vertices
/search?n=6&m_min=10 # 6-vertex graphs with at least 10 edges
Structural Properties
diameter,diameter_min,diameter_max- Filter by graph diameter
radius,radius_min,radius_max- Filter by graph radius
girth,girth_min,girth_max- Filter by girth (shortest cycle length)
triangle_count,triangle_count_min,triangle_count_max- Filter by number of triangles
Examples:
/search?n=8&diameter=2 # 8-vertex graphs with diameter 2
/search?n=7&girth_min=4 # 7-vertex graphs with girth ≥ 4
/search?n=6&radius_min=2&radius_max=3 # 6-vertex graphs with radius 2 or 3
Tags
tags- Filter by named graph types (complete, cycle, path, star, wheel, petersen, etc.)
tag_mode- Use
OR(default) to match ANY tag, orANDto match ALL tags
Available tags: bipartite, complete, complete-bipartite, complete-multipartite, cubic, cycle, eulerian, fan, ladder, line-graph, path, petersen, planar, prism, regular, star, strongly-regular, tree, triangle-free, vertex-transitive, wheel, windmill
Examples:
/search?tags=complete # All complete graphs
/search?tags=bipartite&tags=planar&tag_mode=OR # Graphs that are bipartite OR planar
/search?tags=bipartite&tags=planar&tag_mode=AND # Graphs that are bipartite AND planar
Cospectral Mates
has_cospectral_mate- Filter by cospectrality. Values:
adj,kirchhoff,signless,lap,nb,nbl,dist, ornone
Examples:
/search?n=8&has_cospectral_mate=adj # 8-vertex graphs with adjacency cospectral mates
/search?n=7&has_cospectral_mate=kirchhoff # 7-vertex graphs with Kirchhoff cospectral mates
/search?n=6&has_cospectral_mate=none # 6-vertex graphs with NO cospectral mates
Switching Mechanisms
has_mechanism- Filter by known switching mechanisms. Values:
gm(Godsil-McKay),any, ornone
Examples:
/search?n=8&has_mechanism=gm # Graphs with GM switching mechanisms
/search?n=8&has_mechanism=any # Graphs with any known mechanism
/search?n=8&has_mechanism=none # Graphs with no known mechanism
Pagination
limit- Number of results per page (default: 100, max: 1000)
offset- Number of results to skip
Examples:
/search?n=7&limit=50 # First 50 results
/search?n=7&limit=50&offset=50 # Results 51-100
Complex Queries
Combine multiple filters for sophisticated searches:
# 8-vertex bipartite planar graphs with diameter ≤ 3 and adjacency cospectral mates
/search?n=8&tags=bipartite&tags=planar&tag_mode=AND&diameter_max=3&has_cospectral_mate=adj
# 7-vertex regular graphs with girth ≥ 4 and no cospectral mates
/search?n=7&tags=regular&girth_min=4&has_cospectral_mate=none
# Cubic graphs (3-regular) with 8 vertices and exactly 1 triangle
/search?n=8&tags=cubic&triangle_count=1
Other Endpoints
| Endpoint | Description | Example |
|---|---|---|
GET /graph/{graph6} |
Graph details with cospectral mates | /graph/D?{ |
GET /random |
Redirect to random graph (n=4 to 9) | /random |
GET /random/cospectral |
Random cospectral family | /random/cospectral?matrix=adj |
GET /cospectral-pairs |
Get cospectral pairs | /cospectral-pairs?matrix=adj&n=8 |
GET /compare |
Side-by-side graph comparison | /compare?graphs=D?{,DEo |
GET /similar/{graph6} |
Spectrally similar graphs | /similar/D?{?matrix=adj |
GET /api/graph/{g6}/mechanisms |
Switching mechanisms for graph | /api/graph/GCQvBk/mechanisms |
GET /api/stats/mechanisms |
Mechanism coverage statistics | /api/stats/mechanisms?n=9 |
GET /stats |
Database statistics | /stats |
GET /glossary |
Terminology reference | /glossary |