---
title: Graph Motif Parameters
url: https://www.emergentmind.com/topics/graph-motif-parameters
type: topic
---

# Graph Motif Parameters

Graph motif parameters are graph-theoretic quantities defined from small subgraph structure. In the counting-complexity sense introduced in “Homomorphisms Are a Good Basis for Counting Small Subgraphs” [1705.01595], a graph motif parameter is any graph parameter that depends only on the frequencies of constant-size induced subgraphs: for some fixed $K$, there is a finitely supported coefficient vector $\alpha$ supported on graphs $H$ with $|V(H)| \le K$ such that
$$
f(G)=\sum_H \alpha_H \cdot \operatorname{ind}(H,G).
$$
Equivalent finite representations exist in the subgraph-count basis and in the homomorphism-count basis. In adjacent literatures, the same phrase is used more broadly for motif frequency, size, topology, scarcity, color multiplicities, and other local subgraph descriptors in motif mining, Graph Motif, higher-order clustering, and graph generation [2206.01008].

## 1. Formal definition and linear structure

For graphs $H,G$, the standard counting primitives are
$$
\operatorname{hom}(H,G)=\left|\{\varphi:V(H)\to V(G)\mid \forall uv\in E(H),\ \varphi(u)\varphi(v)\in E(G)\}\right|,
$$
$$
\operatorname{inj}(H,G)=\left|\{\varphi:V(H)\to V(G)\text{ injective}\mid \forall uv\in E(H),\ \varphi(u)\varphi(v)\in E(G)\}\right|,
$$
$$
\operatorname{sub}(H,G)=\operatorname{inj}(H,G)/|\operatorname{Aut}(H)|,
$$
and $\operatorname{ind}(H,G)$, the number of induced subgraphs of $G$ isomorphic to $H$ [1705.01595]. If $\Pi(V(H))$ denotes the partition lattice on $V(H)$ and $\pi\in\Pi(V(H))$, then $H/\pi$ is the quotient graph obtained by identifying the vertices in each block of $\pi$, discarding loops when targeting simple graphs [1705.01595].

A graph motif parameter is therefore a finite-support linear functional on induced-subgraph counts. For fixed $K$, the feature vector may be taken as all $\operatorname{ind}(H,G)$ over unlabeled graphs $H$ of size at most $K$, and the dimension equals the number of isomorphism types on at most $K$ vertices [1705.01595]. The same vector space admits multiple canonical bases: induced-subgraph counts, subgraph counts, and homomorphism counts are all interchangeable finite bases.

This linear-algebraic viewpoint is encoded by the infinite matrix $\mathrm{IndSub}$ with entries $\mathrm{IndSub}(H,G)=\operatorname{ind}(H,G)$, indexed by unlabeled graphs and ordered by total size $|V|+|E|$. That matrix is upper triangular with diagonal entries $1$, so finite-support rows span an infinite-dimensional vector space of graph motif parameters [1705.01595]. This formulation makes motif parameters comparable to other graph statistics built from local pattern frequencies, including graphon homomorphism densities $t(H,G)=\operatorname{hom}(H,G)/n^{|V(H)|}$ in graph limit theory [1705.01595].

## 2. Homomorphisms as a basis

The central structural result is that homomorphism counts form a particularly effective basis. Between subgraph counts and induced-subgraph counts, one has
$$
\operatorname{sub}(H,G)=\sum_F \operatorname{Ext}(H,F)\cdot \operatorname{ind}(F,G),
$$
where $\operatorname{Ext}(H,F)$ counts extensions of $H$ to $F$ on the same vertex set, equivalently $\operatorname{Ext}(H,F)=[|V(H)|=|V(F)|]\cdot \operatorname{sub}(H,F)$ [1705.01595]. Möbius inversion on the edge-subset lattice yields
$$
\operatorname{Ext}^{-1}(H,F)=(-1)^{|E(F)|-|E(H)|}\operatorname{Ext}(H,F),
$$
so induced and non-induced subgraph counts are basis-equivalent.

Between homomorphisms and subgraphs, one has the surjective factorization
$$
\operatorname{hom}(H,G)=\sum_F \operatorname{surj}(H,F)\cdot \operatorname{sub}(F,G),
$$
where $\operatorname{surj}(H,F)$ counts surjective homomorphisms $H\to F$ [1705.01595]. The inverse transformation is given by Möbius inversion on the partition lattice:
$$
\operatorname{surj}^{-1}(H,F)=
\frac{(-1)^{|V(H)|-|V(F)|}}{|\operatorname{Aut}(H)|}
\sum_{\pi\in \Pi(V(H)),\,H/\pi\simeq F}\ \prod_{B\in \pi} (|B|-1)!.
$$
Equivalently, injective homomorphisms satisfy
$$
\operatorname{inj}(H,G)=\sum_{\pi\in \Pi(V(H))}\mu(\pi)\cdot \operatorname{hom}(H/\pi,G),
$$
with
$$
\mu(\pi)=(-1)^{|V(H)|-|V(H/\pi)|}\prod_{B\in\pi}(|B|-1)!.
$$
Hence
$$
\operatorname{sub}(H,G)=\frac{1}{|\operatorname{Aut}(H)|}\sum_{\pi\in\Pi(V(H))}\mu(\pi)\cdot \operatorname{hom}(H/\pi,G).
$$

The support of this hom-basis expansion is the “spasm” of $H$,
$$
\operatorname{Spasm}(H)=\{F\mid \operatorname{surj}(H,F)>0\},
$$
namely the loop-free homomorphic images obtained by merging non-adjacent vertices of $H$ [1705.01595]. The inverse matrix $\operatorname{surj}^{-1}(H,F)$ is nonzero exactly on $\operatorname{Spasm}(H)$. This support controls both algorithm design and hardness.

The basis theorem can be stated in finite-dimensional form. For any finite set $S$ of graphs closed under surjective homomorphisms, the principal submatrix $\mathrm{Hom}_S$ is invertible and
$$
\mathrm{Hom}_S=\mathrm{Surj}_S\cdot \mathrm{Sub}_S.
$$
Thus homomorphism rows with finite support are linearly independent and form a basis [1705.01595]. In later work on expressivity, this support description is also what determines the Weisfeiler–Leman dimension of subgraph-counting parameters: for a labeled pattern $H$, $\mathrm{WL}$-dimension of $\operatorname{sub}_H$ is $\max\{\operatorname{tw}(F):F\in \operatorname{spasm}(H)\}$, whereas $\operatorname{ind}_H$ has $\mathrm{WL}$-dimension $|V(H)|-1$ [2309.17053].

## 3. Algorithms and complexity dichotomies

The algorithmic consequence of the hom-basis expansion is that counting copies of a fixed pattern can be reduced to counting homomorphisms from the graphs in its spasm. For fixed $H$ with $k=|V(H)|$ and treewidth $\operatorname{tw}(H)$, $\operatorname{hom}(H,G)$ can be computed deterministically in time
$$
\exp(O(k))+\operatorname{poly}(k)\cdot n^{\operatorname{tw}(H)+1},
$$
and if $\operatorname{tw}(H)\le 2$, then in time $\operatorname{poly}(|V(H)|)\cdot n^\omega$, where $\omega<2.373$ is the matrix-multiplication exponent [1705.01595].

For subgraph counting, if
$$
t=\max_{F\in \operatorname{Spasm}(H)} \operatorname{tw}(F),
$$
then the expansion
$$
\operatorname{sub}(H,G)=\sum_{F\in \operatorname{Spasm}(H)} c_F\cdot \operatorname{hom}(F,G)
$$
gives an algorithm for $\#\operatorname{Sub}(H,G)$ in time
$$
k^{O(k)}\cdot n^{t+1}.
$$
Using the Scott–Sorkin bound that every $k$-edge graph has treewidth at most $(13/75)k+o(k)<0.174k$, one obtains
$$
\#\operatorname{Sub}(H,G)\ \text{in time}\ k^{O(k)}\cdot n^{0.174k+o(k)},
$$
which improves previously known exponents such as $O(n^{0.91k+c})$ for $k$-edge matchings and $O(n^{0.46k+c})$ for $k$-cycles [1705.01595].

The same paper proves a general parameterized dichotomy for evaluating finite linear combinations of homomorphism counts. Given input $(\alpha,G)$ with
$$
(\alpha\cdot \mathrm{Hom})(G)=\sum_i \alpha_i\cdot \operatorname{hom}(H_i,G),
$$
and parameter $|\alpha|$, let
$$
\operatorname{tw}(\alpha)=\max_{H\in \operatorname{supp}(\alpha)} \operatorname{tw}(H).
$$
If $\operatorname{tw}(\alpha)\le t$ is bounded, evaluation runs in time
$$
g(\alpha)+\operatorname{poly}(|\alpha|)\cdot n^{t+1}.
$$
Otherwise the problem is $\#\mathrm{W}[1]$-hard, and under $\#\mathrm{ETH}$ no algorithm runs in time
$$
g(\alpha)\cdot n^{o(t/\log t)}.
$$
The extraction lemma behind the lower bound uses categorical products and the identity
$$
\operatorname{hom}(F,G\times X)=\operatorname{hom}(F,G)\cdot \operatorname{hom}(F,X),
$$
which makes a linear combination at least as hard as its hardest summand [1705.01595].

A related approximation landscape appears in parameterized counting of connected induced subgraphs and Graph Motif. Exactly counting connected induced $k$-vertex subgraphs is $\#\mathrm{W}[1]$-complete, but there is an FPTRAS whenever the monotone property $\Phi$ has edge-minimal witnesses of bounded treewidth; counting Graph Motif inherits this approximation scheme because connectedness has trees as minimal witnesses [1308.1575].

## 4. Colored, decision, and local clustering variants

A distinct but closely related tradition studies colored motifs. In the vertex-colored extension of graph motif parameters, one counts color-preserving copies of a colored pattern $H$ in a colored graph $G$, with inclusion–exclusion restricted to color-respecting partitions. The resulting complexity classification is a trichotomy: polynomial-time solvable, fixed-parameter tractable, or $\#\mathrm{W}[1]$-hard, depending on the treewidth of the colored hom-basis support and on additional structural obstructions such as large half-colorful matchings [1705.01595].

The classical Graph Motif problem is a decision problem on a vertex-colored graph $G=(V,E)$ with color function $c:V\to C$ and a multiset motif $M$: one asks whether there exists $V_H\subseteq V$ such that $G[V_H]$ is connected and the multiset of colors on $V_H$ equals $M$ [1202.5184]. In the standard parameterization by $k=|M|$, Graph Motif is FPT, with a randomized $O^*(2^k)$ algorithm and an improved algebraic formulation via constrained multilinear detection giving a randomized $O^*(2.54^k)$ algorithm for Graph Motif and $O^*(5.08^k)$ for Min-Substitute [1202.5184]. Parameterizations by the number of distinct colors $d$, substitution budget $s$, or structural graph parameters yield a detailed landscape: Graph Motif is W[1]-hard by $d$ even on trees, polynomial on trees in time $O(n^{2d+2})$ when $d$ is small, and FPT or para-NP-hard depending on parameters such as distance to clique, vertex cover number, edge clique cover, cluster editing number, or max leaf number [1202.5184].

Structural parameterizations make the dependence on graph topology explicit. Graph Motif can be solved in time $O^*(3^k)$ when parameterized by distance to clique, in time $O^*(2^{2k\log k})$ when parameterized by the size of a minimum vertex cover, and in time $O^*(8^k)$ via neighborhood diversity when parameterized by cluster editing number [1503.05110]. By contrast, it remains NP-hard on trees of maximum degree $3$, at distance $1$ to cluster, at distance $1$ to disjoint paths, and even on graphs of bandwidth $6$ [1503.05110].

The dual parameter $\ell=|V|-|M|$ induces another set of motif parameters. Under this parameter, Colorful Graph Motif on general graphs has no $(2-\epsilon)^\ell\cdot |V|^{O(1)}$ algorithm under SETH, List-Colored Graph Motif is W[1]-hard even for lists of size at most two, Graph Motif on trees is solvable in $O(3^\ell\cdot |V|)$ time, and Colorful Graph Motif on trees admits an $O(\sqrt{2}^{\,\ell}+|V|)$ algorithm and a kernel of size at most $2\ell+1$ vertices [1908.03870].

Motif parameters also underlie higher-order local clustering. For a motif template $M$, one defines motif degree
$$
d_M(v)=\sum_{e\in I_M:\,v\in e} w_e,
$$
motif volume
$$
\operatorname{vol}_M(S)=\sum_{v\in S} d_M(v),
$$
hypergraph motif cut
$$
\operatorname{cut}_M^H(S,\bar S)=\sum_{e\in E_H} w_e\cdot \mathbf 1[e\cap S\neq \emptyset,\ e\cap \bar S\neq \emptyset],
$$
and projected-graph adjacency
$$
A_M(u,v)=\sum_{e\in E_H:\,u,v\in e} w_e/(|e|-1).
$$
For triangles, the projected-graph cut equals the number of cut triangles, so motif conductance
$$
\Phi_M(S)=\operatorname{cut}_M^G(S,\bar S)/\min\{\operatorname{vol}_M(S),\operatorname{vol}_M(\bar S)\}
$$
is especially interpretable [2205.06176]. In the global clustering setting, motif conductance is also the basis of PSMC, whose vertex-level parameter
$$
Mr_S(u)=\frac{\mathbb M(u)+\mathbb M_k^S(u)-\mathbb M_1^S(u)}{\mathbb M(u)}
$$
supports a peeling algorithm with motif-independent approximation guarantee
$$
\phi_{\mathbb M}(\hat S)\le \frac12+\frac12\,\phi_{\mathbb M}^*
$$
for any motif [2406.07357].

## 5. Statistical and probabilistic motif parameters

In statistical network analysis, motif parameters often mean expected counts, significance scores, or model coefficients attached to motifs. For exchangeable graph generative models with latent variable $z$ and conditional edge probabilities $R_z(u,v)$, the central identity is
$$
\mathbb E[N_H(G)\mid z]=N_H(G_z),
$$
where $G_z$ is the weighted graph with adjacency $A_z[u,v]=R_z(u,v)$ [2305.01089]. Hence
$$
\mathbb E[N_H(G)]=\int N_H(G_z)\,p(z)\,dz.
$$
For graphons $W$, this yields exact finite-$n$ formulas
$$
\mathbb E[N_H^{\mathrm{nonind}}(G_n)]=(n)_k\, t(H,W),\qquad
\mathbb E[N_H(G_n)]=(n)_k\, t_{\mathrm{ind}}(H,W),
$$
and unordered counts are obtained by dividing by $\operatorname{aut}(H)$ [2305.01089].

Exponential random graph models encode motif parameters directly as sufficient statistics. With
$$
P_\theta(Y=y)=\exp\{\theta^\top g(y)\}/\kappa(\theta),
$$
triangle closure in undirected PPI networks is modeled by an alternating triangle statistic, and feed-forward loops in directed regulatory networks by an alternating transitive-triangle statistic [2001.11125]. In the reported models, the triangle and transitive-triangle parameters are significantly positive in yeast and human PPI networks and in *E. coli* and yeast regulatory networks, while under-representation of cyclic triangles can be explained by other topological terms without adding an explicit cyclic-triangle parameter [2001.11125].

Temporal graph generation uses another motif parameterization. In the Motif Transition Model, motif states are temporal motifs $M_i^l$, transitions are $T(M_i^l\to M_j^{l+1})$, and the governing parameters are transition probabilities
$$
P(M_j^{l+1}\mid M_i^l)=
\frac{C_{M_i^l\to M_j^{l+1}}}{C_{M_i^l\to S}+\sum_k C_{M_i^l\to M_k^{l+1}}},
$$
stopping probabilities $P(M_i^l\to S)$, exponential transition rates
$$
\lambda_{m\to n}=1/\operatorname{mean}(\Delta_t),
$$
and calibration quantities such as the cold-event degree sequence $K_{CE}$, cold-event timestamps $T_{CE}$, and the edge-creation calibration $\mu$ [2306.11190]. These motif parameters determine both the structural evolution and the inter-event timing of generated temporal networks.

Random graph models built from motifs reveal another parameter layer. In the binomial random motif graph $G(H,n,p)$, thresholds for connectivity, perfect matching, and Hamiltonicity are controlled by
$$
m_1(H)=\binom{n-1}{k-1}\cdot k!/\operatorname{aut}(H),
$$
the minimum degree $\delta(H)$, and the motif-dependent subgraph appearance parameter $\bar\gamma(S,H)$ [1907.12043]. For example,
$$
p_c(n)\sim (\ln n)/m_1(H),
$$
and the same threshold governs perfect matchings, while Hamiltonicity depends on the correction term $\delta_2(H)=\lceil 2/\delta(H)\rceil-1$ [1907.12043].

Spatial random graphs exhibit motif parameters tied to geometry. In random geometric graphs on the $d$-dimensional unit torus with $N$ nodes and connection radius $r$, symmetric motifs are subsets of nodes with identical adjacencies. Their occurrence depends on $d$, $N$, $r$, the minimum inter-point distance $D_{\min}$, and the excluded-neighborhood volume $|N_{\mathrm{ex}}(s,r)|$ [1704.00640]. In the thermodynamic limit at fixed mean degree, the probability that the closest pair is Type-I symmetric tends to $1$ in all dimensions studied; in the intensive limit, the probability tends to $1$ in $d=1$, to a nontrivial constant in $d=2$, and to $0$ in $d=3$ [1704.00640].

## 6. Learning-based motif parameters

Machine-learning treatments usually parameterize motifs by continuous embeddings rather than by exact isomorphism classes. In “Approximate Network Motif Mining Via Graph Learning” [2206.01008], motifs are defined as connected subgraphs that are statistically over-represented relative to a null model, but occurrences may be approximate under a similarity function $\operatorname{sim}$. The core motif parameters are motif number
$$
f_m(G)=|M(m\mid G)|,
$$
motif size
$$
s(m)=|V(m)|,
$$
motif topology, and scarcity, operationalized by the embedding-space density contrast
$$
\Delta_f(z;Z,\tilde Z)=\hat f_Z(z)-\hat f_{\tilde Z}(z).
$$
The method formulates motif mining as node labeling and evaluates recovery by soft M-Jaccard over predicted and planted motif memberships [2206.01008].

A different learned parameterization appears in MICRO-Graph, where motifs are continuous centroids
$$
M=\{m_k\in \mathbb R^d\}_{k=1}^K
$$
in embedding space [2012.12533]. Node-to-motif responsibilities are
$$
Q_{v,k}=
\frac{\exp(\phi(W_hx_v)^\top \phi(m_k)/\tau)}
{\sum_{k'}\exp(\phi(W_hx_v)^\top \phi(m_{k'})/\tau)},
$$
balanced through a Sinkhorn step, while subgraph-to-motif responsibilities use analogous softmax assignments on pooled subgraph embeddings. The combined motif objective
$$
\mathcal L_{\mathrm{motif}}=
\lambda_n\mathcal L_{\mathrm{node-mot}}
+\lambda_s\mathcal L_{\mathrm{mot-sub}}
+\lambda_r\mathcal L_{\mathrm{reg}}
$$
learns motif centroids, node assignments, and connected subgraph partitions, which then guide graph-to-subgraph contrastive learning [2012.12533].

Motif prediction in dynamic link formation uses still another parameterization. For a specified motif $M=(V_M,E_M)$, the relevant parameters are the motif edges $E_M$, deal-breaker edges $E_{M,D}$, and correlation-aware edge weights $w$ [2106.00761]. Independent-edge heuristics use products of edge scores, while correlated heuristics use convex combinations and negative terms for deal-breakers. The SEAM architecture augments local enclosing subgraphs with motif-aware inner and outer labels and predicts motif appearance probabilities with a GNN, consistently outperforming link-based baselines in AUC on $k$-stars, $k$-cliques, and dense clusters [2106.00761].

These learning-based definitions change the semantics of “graph motif parameters.” The object is no longer only a fixed linear functional on induced-subgraph counts; it may instead be a learned prototype set, a density-contrast score, or a collection of soft assignment variables. A plausible implication is that the algebraic basis view and the learned embedding view describe complementary regimes: one prioritizes exact combinatorial semantics, the other approximate structural recurrence.

## 7. Expressivity, counting interpretation, and broader generalizations

The expressive power of motif parameters has been characterized in several orthogonal directions. For labeled graph motif parameters
$$
\Gamma(G)=\sum_i \mu_i\cdot \operatorname{homs}(F_i,G),
$$
the $\mathrm{WL}$-dimension equals
$$
\max\{\operatorname{tw}(F):F\in \operatorname{Supp}(\Gamma)\},
$$
and whenever this value is at most $k$, there exists a local readout function on stable $k$-WL colors such that
$$
\Gamma(G)=\sum_{\bar x\in V(G)^k}\theta_\Gamma(c^{(\infty)}(\bar x)).
$$
Thus exact motif counts can be recovered uniformly from local information in the last layer of a corresponding higher-order GNN whenever $k$-WL distinguishes them [2309.17053].

A different question is which motif parameters genuinely “count something.” For pure graph motif parameters
$$
f(G)=\sum_i \alpha_i\cdot \#\mathrm{IndSub}(H_i,G),
$$
where the $H_i$ have no isolated vertices, evaluation belongs to the oracle counting class $\#\bullet \mathrm P^{\mathrm{Pr}}$ if and only if all coefficients $\alpha_i$ are nonnegative integers [2507.12244]. Nonnegativity of the function on all input graphs is not sufficient: the paper gives pure examples with a negative coefficient that remain nonnegative on every graph but have no combinatorial interpretation in the oracle-\#P sense [2507.12244]. This result extends to relational structures, including colored graphs, and further to categorical motif parameters defined from subobject counts in categories such as finite vector spaces and parameter sets.

The categorical generalization clarifies why linear combinations are natural. In settings with finite coproducts and an appropriate factorization system, polynomials in subobject counts linearize into nonnegative integer combinations of subobject-count functions [2507.12244]. This abstraction places graph motif parameters alongside subspace counts in finite vector spaces and related Ramsey-theoretic counting theories.

Taken together, these results give graph motif parameters a dual status. They are, first, concrete local-structure coordinates for graphs, admitting exact basis changes among induced counts, subgraph counts, and homomorphism counts [1705.01595]. They are, second, computational and statistical objects whose tractability, expressivity, and even interpretability are governed by treewidth, support closure under homomorphic images, sign patterns of coefficients, color structure, and the probabilistic model under which motifs are observed [1705.01595].

Source: https://www.emergentmind.com/topics/graph-motif-parameters