Advanced maths

Graph truss decomposition calculator with edge triangle support

Assign each graph edge a trussness by recursive triangle-support peeling and verify support at every retained level.

Your numbers

Zero-based labels 0 through n−1, including isolated vertices.
One row: u v. No loops or duplicate unordered pairs.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Assign each graph edge a trussness by recursive triangle-support peeling and verify support at every retained level.

THE FORMULAsupport_H(uv)=|N_H(u)∩N_H(v)|; k-truss requires support_H(e)≥k−2; trussness(e)=max{k:e∈T_k}.

A worked example

The six edges of K4 each lie in two triangles and have trussness 4. An attached tail edge lies in no triangles and has trussness 2. The graph contains four triangles.

Good to know

Simple undirected graph on 1–150 vertices with at most 1,500 edges; integer triangle counts and direct support peeling. k minus 2 convention, isolates accepted, isolated edges trussness 2, edgeless maximum 0. Level unions need not be connected. No weighted, directed or streaming-scale claim.

Measure cohesion through edge triangles

The support of an edge is the number of triangles containing it. A k-truss retains edges whose support within the retained subgraph is at least k minus two. The key phrase is within the retained subgraph: triangles that use an edge already removed no longer provide support.

Truss decomposition assigns each original edge the largest k for which it belongs to that level. This is an edge-based measure and differs from k-core decomposition, which peels vertices by degree. High vertex degree alone does not imply that an edge participates in many closed triangles.

The six edges of K4 each lie in two triangles and have trussness 401234K4 edges: truss 4Tail edge: truss 2Four trianglesSupport threshold = k−2
Scroll across to see the full diagram.
The six edges of K4 each lie in two triangles and have trussness 4. An attached tail edge lies in no triangles and has trussness 2. The graph contains four triangles.

Compare this with the Graph k core decomposition calculator with a degeneracy ordering. Peel edges by triangle support and assign edge trussness; core decomposition peels vertices by degree.

Simple edges and the k minus two convention

Declare all vertices and enter each undirected edge once. Loops, parallel pairs and directed edges are not supported. The implementation uses the convention that a triangle is a three-truss and a complete four-vertex graph is a four-truss, because their edge supports are one and two respectively.

An isolated edge belongs to the two-truss even though it has no supporting triangle. An entirely edgeless graph has no edge trussness values; this page reports maximum truss zero for that boundary case. These conventions are stated explicitly because some literature shifts the truss parameter by two.

Support changes during peeling

The calculator begins by counting every edge's original triangle support. It repeatedly removes an active edge of minimum current support. Whenever that deletion destroys a currently active triangle, the support of its other two edges decreases by one, because that triangle can no longer sustain them.

The assigned peel level never decreases. This preserves a triangle's shared truss level even though later edges can lose support after an earlier edge is removed. Using original supports alone would miss these cascades and can assign an incorrect level to edges in structures where triangle support collapses under peeling.

A complete four-vertex block plus a tail

The default graph contains all six edges among vertices zero, one, two and three, plus a tail edge from three to four. The complete block contains four triangles. Each of its six edges initially lies in exactly two of those triangles.

The tail has support zero and trussness two. Removing it does not destroy any triangle, so the complete block remains a four-truss. None of its edges can reach level five because that would require at least three surviving triangles per edge. The maximum truss is therefore four, with the six dense-block edges at that level.

Inspect edge values and level certificates

The edge table reports both initial triangle support and final trussness. They answer different questions: the first is measured in the original graph, while the second incorporates recursive support loss. The level summary states how many edges and vertices remain at each k.

For every reported level, the calculator recomputes the minimum support inside the subgraph consisting of edges whose trussness is at least k. That value must be at least k minus two. This independent post-peel check helps catch an incorrect update rule and explains why a high assigned level is supported by an actual retained subgraph.

Scale and structural limitations

The accepted graph contains at most 150 vertices and 1,500 edges. The decomposition uses exact integer triangle counts for a finite simple graph, with a bounded direct implementation rather than a claim of industrial-scale streaming performance. Large complete graphs may exceed the edge limit even when the vertex count is permitted.

The result does not require each k-truss level to be connected. Several dense regions can coexist at the same level, and the level table summarizes their union. If an application needs separate connected truss communities, that is an additional component analysis rather than an extra meaning automatically supplied by the maximum truss number.

Avoid confusing cohesion with importance

A bridge between two dense regions can have zero triangle support even when removing it disconnects the graph. Low trussness therefore does not mean that an edge is unimportant for global connectivity. It means that the edge is not sustained by the specified local triangle-density condition.

Likewise, a high truss level is a structural property of the entered network, not proof of a real community, shared purpose or trustworthy relationship. Use trussness alongside connectivity or other suitable measures when those questions matter. The calculator supplies the triangle-based decomposition and its certificates without assigning an interpretation that the graph data cannot establish.

A few questions, answered

Does k-truss mean k supporting triangles per edge?

This page uses k minus two supporting triangles per edge, so a triangle is a three-truss.

Why do original supports not determine trussness directly?

Removing one edge destroys triangles and can reduce support of neighboring edges, causing a recursive peeling cascade.

Can a bridge have low trussness but remain important?

Yes. A bridge belongs to no triangle but can still be essential to connectivity between dense regions.

Must each reported truss level be connected?

No. A level can contain several disconnected dense regions; the summary describes their union.

Find your calculator

Start typing to explore the library.