Skip to Content
ResearchCRPCComplexity & optimization

Complexity and optimization

In the general protocol, the number of reference pairwise comparisons scales with how many neighbors each node has—but who is adjacent to whom is left to the implementer.

If each node only has O(1) neighbors, work stays O(n) in n nodes. If the graph is fully connected—every node neighbors every other—the count of edges (hence comparisons) is quadratic, O(n²).

Complete graphs K2K_2 and K3K_3

For |V| = 2 or 3, even a complete graph is tiny: 1 or 3 reference pairwise comparisons respectively, so complexity is not a practical concern yet.

Complete graphs K2 and K3: one and three reference pairwise comparisons
Complete graphs K2K_2 and K3K_3 (reference export).

Complete graphs with V>3|V| > 3

Beyond K3K_3, the edge count of a clique keeps growing quadratically.

Complete graph growth beyond K3: quadratic edge growth

K4K_4 with four vertices and six edges (reference export; prose in the source names this graph explicitly).

For a complete graph on n vertices, the number of edges is

E=n(n1)2.|E| = \frac{n(n - 1)}{2}.
Illustration for counting edges in a complete graph
Edge-count relationship for a complete graph (reference export).

With more than three nodes, fully connected CRPC graphs become expensive fast—each edge also implies two reciprocal attestations, so stored comparison data is 2 × |E|.

Note: Multiply reference comparisons (edges) by two to get the number of published pairwise attestations.

Ring topology

The usual sparse choice is a ring: each node has at most two neighbors. Reference comparisons then scale linearly with n while still yielding useful per-node attestations.

Ring topology: each node has at most two neighbors
Ring topology (reference export); pair with the C6C_6 sketch below.

In a C6C_6 example, five nodes may pass local checks while one fails—illustrating how more participants make disputes easier to surface.

We suggest a minimum of three nodes in practice so that, if one node disputes, two others still contribute independent signal.

Complete graphs: comparisons grow as Θ(n²); simple cycles: Θ(n) edges, times two for reciprocity—so dense topologies blow up much faster.

NodesEdges: completeEdges: cycle
211
333
464
5105
6156
7217
8288

Solving the drift problem

For rings with |V| ≥ 4, local thresholds can hide global inconsistency: each edge may look fine while a non-edge pair (e.g. opposite on the ring) would violate ε if measured directly. Call that accumulated gap drift.

Example on C4C_4

Take nodes N1N4N_1 \ldots N_4 with scalar results:

  • N1=1.0N_1 = 1.0
  • N2=1.1N_2 = 1.1
  • N3=1.2N_3 = 1.2
  • N4=1.1N_4 = 1.1
  • ϵ=0.15\epsilon = 0.15

Every measured adjacent difference is ≤ 0.1 < 0.15, so all δij<ϵ\delta_{ij} < \epsilon on edges. Yet N1N3=0.2>0.15\lvert N_1 - N_3 \rvert = 0.2 > 0.15unmeasured drift the naive ring never sees.

Fully connecting the graph would catch that but reintroduces O(n²) edges.

Local vs global ε

Split the budget: let ϵglob\epsilon_{\text{glob}} be the true tolerance you care about, and set a stricter per-edge tolerance ϵloc\epsilon_{\text{loc}} derived from n.

Use

ϵloc=ϵglobn/2\epsilon_{\text{loc}} = \frac{\epsilon_{\text{glob}}}{\lfloor n/2 \rfloor}

On a cycle, the worst-case hop distance between two nodes is about ⌊n/2⌋; if each edge obeys an L-Lipschitz-style bound with L=ϵlocL = \epsilon_{\text{loc}}, then diametrically opposite values are bounded by roughly Ln/2ϵglobL \cdot \lfloor n/2 \rfloor \leq \epsilon_{\text{glob}}. (The write-up ties this to choosing ϵloc\epsilon_{\text{loc}} so unmeasured pairs stay below ϵglob\epsilon_{\text{glob}} without a clique.)

That lets you keep linear edge count while implicitly controlling non-edges, at the cost of tighter per-edge thresholds as n grows.

Demonstration: catching unacceptable drift

Reuse the C4C_4 example with ϵglob=0.15\epsilon_{\text{glob}} = 0.15:

ϵloc=0.154/2=0.152=0.075.\epsilon_{\text{loc}} = \frac{0.15}{\lfloor 4/2 \rfloor} = \frac{0.15}{2} = 0.075.

Now δ12=N1N2=0.1>0.075\delta_{12} = \lvert N_1 - N_2 \rvert = 0.1 > 0.075—the first edge fails the stricter local rule, so we reject the configuration before trusting unmeasured pairs such as (N1,N3)(N_1, N_3).

Even without explicitly computing δ13=0.2\delta_{13} = 0.2, we already know 0.2>ϵglob0.2 > \epsilon_{\text{glob}} would have been a problem; ϵloc\epsilon_{\text{loc}} gives a linear-time certificate that would have been invisible under a single naive ϵ\epsilon on the ring alone.

In practice, tightening ϵloc\epsilon_{\text{loc}} buys much of the safety of a dense graph while keeping sparse topology.

Last updated on