The k-Truss algorithm identifies the maximal cohesive subgraph called truss in the graph. It has wide-ranging applications across various domains, including social networks, biological networks, and transportation networks. By uncovering communities or clusters of closely related nodes, the k-Truss algorithm provides valuable insights into the structure and connectivity of complex networks.
k-Truss were originally defined by J. Cohen in 2005:
The truss is motivated by a natural observation of social cohesion: if two people are strongly tied, it is likely that they also share ties to others. k-Truss is thus created in this way: a tie between A and B is considered legitimate only if supported by at least k–2 other people who are each tied to A and to B. In other words, each edge in a k-truss joins two nodes that have at least k–2 common neighbors.
The formal definition is, a k-truss is a maximal subgraph in the graph such that each edge is supported by at least k–2 pairs of edges making triangles with the that edge.
The entire graph is shown below, the 3-truss and 4-truss are highlighted in red. This graph does not have truss with 5 or larger value of k.

Ultipa's k-Truss algorithm identifies the maximal truss in each connected component.
algo(k_truss)Name | Type | Spec | Default | Optional | Description |
|---|---|---|---|---|---|
| k | int | ≥2 | / | No | Each edge in the k-truss is contained in at least k − 2 triangles |
The example graph is as follows:

Spec | Content | Description |
|---|---|---|
| filename | _id--[_uuid]--_id | One-step path in the truss: (start node)--(edge)--(end node) |
UQLalgo(k_truss).params({k: 4}).write({ file:{ filename: 'truss' } })
Results: File truss
Filed--[102]--a c--[103]--a d--[104]--c f--[105]--a f--[106]--d d--[107]--f f--[108]--d d--[109]--e e--[110]--f f--[111]--c k--[117]--f k--[119]--l g--[120]--k m--[121]--k i--[122]--f m--[123]--f f--[124]--g g--[125]--m m--[126]--l
Alias Ordinal | Type | Description |
|---|---|---|
| 0 | []path | One-step path in the truss: _uuid (start node) -- [_uuid] (edge) -- _uuid (end node) |
UQLalgo(k_truss).params({k: 5}) as truss return truss
Results: subgraph
| 4--[102]--1 |
| 4--[104]--3 |
| 6--[105]--1 |
| 6--[106]--4 |
| 4--[107]--6 |
| 6--[108]--4 |
| 4--[109]--5 |
| 5--[110]--6 |
| 6--[111]--3 |
Alias Ordinal | Type | Description |
|---|---|---|
| 0 | []path | One-step path in the truss: _uuid (start node) -- _uuid (edge) -- _uuid (end node) |
UQLalgo(k_truss).params({k: 5}).stream() as truss5 with pedges(truss5) as e find().edges(e) as edges return edges{*}
Results: edges
| _uuid | _from | _to | _from_uuid | _to_uuid |
|---|---|---|---|---|
| 102 | d | a | 4 | 1 |
| 104 | d | c | 4 | 3 |
| 105 | f | a | 6 | 1 |
| 106 | f | d | 6 | 4 |
| 107 | d | f | 4 | 6 |
| 108 | f | d | 6 | 4 |
| 109 | d | e | 4 | 5 |
| 110 | e | f | 5 | 6 |
| 111 | f | c | 6 | 3 |