Mobility Matters
Home›Mobile agents on graphs›Computing with agents›Triangle and butterfly counting by agents

Triangle and butterfly counting by agents

\(n\) agents in an anonymous graph must count small subgraphs (triangles; butterflies in bipartite graphs) at every node.

Problem statement and measuresexpand

\(n\) agents with distinct identifiers (IDs) are placed on the nodes of an anonymous port-labelled graph with \(n\) nodes, \(m\) edges and maximum degree \(\Delta\). The start is rooted (all agents on one node), dispersed (one agent on each node) or arbitrary. Agents compute only by moving and by talking with agents on the same node. The agents must compute, at every node, the number of triangles (or butterflies) it belongs to: every agent (or node) learns its part of the output. Time is in synchronous rounds; memory in bits per agent.

Measures: Time, rounds; Memory, bits per agent.

Triangle counting

standard settingverified
Time: unknownMemory: unknown

From an arbitrary placement and without prior knowledge, agents count triangles per node and per edge, which yields truss decomposition, triangle centrality and local clustering coefficients.

Assumed (added on the last edge are outlined)

+Graph dynamicsstatic graph+Edge directionundirected+Identifiersdistinct identifiers (eponymous): agents have pairwise distinct identifiers+Communicationlocal (co-located agents communicate)+Timingsynchronous rounds

Not assumed

Knowledgeno knowledge of graph parametersInitial configurationarbitrary (agents on any \(\ell \le k\) nodes)Topologyarbitrary connected graph
Formal definitions of this setting
Graph dynamics: static graph
\(G_t=G\) for all \(t\): the edge set never changes.
Edge direction: undirected
\(G=(V,E)\) with \(E\subseteq\binom V2\); every edge can be traversed in both directions.
Identifiers: distinct IDs (eponymous)
Distinct identifiers (eponymous agents): the label function \(\mathrm{id}:\{1,\dots,k\}\to\{1,\dots,L\}\) is injective; usually \(L=k^{O(1)}\), so a label takes \(O(\log k)\) bits.
Communication: local communication
Agents at the same node at the same time can read each other's entire memory (face-to-face communication). Agents crossing on an edge do not meet.
Timing: synchronous
Time proceeds in rounds \(t=1,2,\dots\); in every round every agent communicates, computes and moves (at most one edge) simultaneously.
Knowledge: no knowledge
Agents know no graph parameter (\(n\), \(m\), \(\Delta\), \(D\)).
Initial configuration: any start
Agents start at arbitrary nodes; \(\ell\le k\) nodes are initially occupied, possibly with several agents each.
Topology: any topology
\(G\) is any connected graph in the class allowed by the other axes.

What is known

Time · rounds
unknown
No lower bound is proved.
lower boundnone known
introductory—
current best
\(O(n\log^2 n + \Delta\log L)\)
Memory · bits per agent
unknown
No lower bound is proved.
lower boundnone known
introductory—
current best
\(O(\Delta\log L)\)

Results, in order of publication

Chand et al. 2026 current best
Time \(O(n\log^2 n + \Delta\log L)\)Memory \(O(\Delta\log L)\)

Introductory and current best (Theorem 2): dispersion, leader election and a spanning tree in \(O(n\log^2 n)\) rounds, then per-node and per-edge counts in \(O(\Delta\log L)\) rounds and the total in \(O(n+\Delta\log L)\). Applications: truss decomposition in \(O(m\Delta\log L + mD)\) rounds with \(O(\Delta^2\log L)\) bits; triangle centrality and local clustering coefficients in \(O(\Delta\log L)\) rounds.

Open questions

None recorded for this variant.

Notes

\(L\) is the largest agent identifier, at most \(n^\kappa\), so \(\log L = O(\log n)\). Exactly \(n\) agents. The problem is posed from a dispersed start, but Theorem 2 needs none. Checked against the full text (arXiv 2402.03653, version 3).

What carries over from neighbouring settings

Read off the order of assumptions, not checked case by case: results may carry extra assumptions (shown on their pages), and asynchronous time is measured in epochs.

Algorithms from weaker settings work here

No catalogued weaker setting.

Lower bounds from stronger settings hold here

Branches from here

Know a better result for this setting, or found a mistake? Suggest a result · Report an error. Accepted contributions are acknowledged.