UltipaDocs
Try Playground
  • Introduction
    • Show Algorithms
    • Install and Uninstall
    • Run Algorithms
    • Algorithm Results and Statistics
    • Degree Centrality
    • Closeness Centrality
    • Harmonic Centrality
    • Graph Centrality
    • Betweenness Centrality
    • Eigenvector Centrality
    • CELF
    • PageRank
    • ArticleRank
    • HITS
    • SybilRank
    • Jaccard Similarity
    • Overlap Similarity
    • Cosine Similarity
    • Pearson Correlation Coefficient
    • Euclidean Distance
    • K-Hop All
    • Bipartite Graph
    • HyperANF
    • Connected Component
    • Triangle Counting
    • Induced Subgraph
    • k-Core
    • k-Truss
    • p-Cohesion
    • k-Edge Connected Components
    • Local Clustering Coefficient
    • Topological Sort
    • Schema Overview
    • Dijkstra's Single-Source Shortest Path
    • Delta-Stepping Single-Source Shortest Path
    • Shortest Path Faster Algorithm (SPFA)
    • Minimum Spanning Tree
    • Breadth-First Search (BFS)
    • Depth-First Search (DFS)
    • Adamic-Adar Index
    • Common Neighbors
    • Preferential Attachment
    • Resource Allocation
    • Total Neighbors
    • Louvain
    • Leiden
    • Label Propagation
    • HANP
    • k-Means
    • kNN (k-Nearest Neighbors)
    • K-1 Coloring
    • Conductance
      • Random Walk
      • Node2Vec Walk
      • Node2Vec
      • Struc2Vec Walk
      • Struc2Vec
      • GraphSAGE
      • GraphSAGE Train
      • LINE
      • Fast Random Projection
      • Summary of Graph Embedding
      • Gradient Descent
      • Backpropagation
      • Skip-gram
      • Skip-gram Optimization
  1. Docs
  2. /
  3. Graph Analytics & Algorithms
  4. /
  5. Connectivity & Compactness

k-Truss

✓ File Writeback ✕ Property Writeback ✓ Direct Return ✓ Stream Return ✕ Stats

Overview

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:

  • J. Cohen, Trusses: Cohesive Subgraphs for Social Network Analysis (2005)

Concepts

k-Truss

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.

Considerations

  • At least 3 nodes are contained in a truss (when k≥3).
  • In a complex graph where multiple edges can exist between two nodes, the triangles in a truss are counted by edges. Please also refer to the Triangle Counting algorithm.
  • The k-Truss algorithm ignores the direction of edges but calculates them as undirected edges.

Syntax

  • Command: algo(k_truss)
  • Parameters:
Name
Type
Spec
Default
Optional
Description
kint≥2/NoEach edge in the k-truss is contained in at least k − 2 triangles

Examples

The example graph is as follows:

File Writeback

Spec
Content
Description
filename_id--[_uuid]--_idOne-step path in the truss: (start node)--(edge)--(end node)
UQL
algo(k_truss).params({k: 4}).write({
  file:{
      filename: 'truss'
  }
})

Results: File truss

File
d--[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

Direct Return

Alias Ordinal
Type
Description
0[]pathOne-step path in the truss:
_uuid (start node) -- [_uuid] (edge) -- _uuid (end node)
UQL
algo(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

Stream Return

Alias Ordinal
Type
Description
0[]pathOne-step path in the truss:
_uuid (start node) -- _uuid (edge) -- _uuid (end node)
UQL
algo(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
102da41
104dc43
105fa61
106fd64
107df46
108fd64
109de45
110ef56
111fc63