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

p-Cohesion

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

Overview

The p-Cohesion algorithm identifies groups of network players (nodes) that are highly connected with each other, represented by cohesive subgraphs. It provides valuable insights into the level of connectivity and interdependence within these groups, enabling in-depth analysis of the graph structure and its implications.

The concept of p-cohesion was first proposed by S. Morris in a contagion model of the interaction among large populations:

  • S. Morris, Contagion. The Review of Economic Studies, 67(1), 57–78 (2000)

Concepts

p-Cohesion

One natural measure of the 'cohesion' of a group is the relative frequency of ties among group members compared to non-members. Let the cohesion be a constant p ∈ (0,1), a p-cohesion is a connected subgraph in which every node has, at least, a proportion p of its neighbors within the subgraph, i.e., at most, a proportion (1 − p) of its neighbors outside.

The p-Cohesion model offers two distinct advantages compared to other cohesive subgraph models:

  • With a large p value, a p-cohesion ensures not only inner-cohesiveness, but also outer-sparseness.
  • In many scenarios, considering the percentage of neighbors rather than a fixed number of neighbors (such as the k value in k-Core) is more appropriate due to variations in node degrees.

Below shows an example graph. Suppose p = 0.6, a grey label is put next to each node indicating the smallest number of neighbors required for the node to stay in a p-cohesion.

Below are the minimal (in terms of the number of nodes) p-cohesion subgraphs including node a and node j respectively.

Ultipa's p-Cohesion algorithm finds the approximate minimal p-cohesion subgraph for each query node, and returns each subgraph in the form of its node set.

Considerations

  • The p-Cohesion algorithm ignores the direction of edges but calculates them as undirected edges.

Syntax

  • Command: algo(p_cohesion)
  • Parameters:
Name
Type
Spec
Default
Optional
Description
ids / uuids[]_id / []_uuid//YesID/UUID of the query nodes; find the approximate minimal p-cohesions that include each query node respectively; query all nodes if not set
pfloat(0,1)/NoEach node in a p-cohesion has at least a proportion p of its neighbors within the p-cohesion, and at most a proportion (1 − p) of its neighbors outside

Examples

The example graph is as follows:

File Writeback

Spec
Content
Description
filenamesubgraphN: _id,_id,...Nodes that are contained in each p-cohesion subgraph
UQL
algo(p_cohesion).params({
  ids: ['A', 'I'],
  p: 0.7
}).write({
  file: {
    filename: "cohesion"
  }
})

Statistics: num of subgraphs = 2
Results: File cohesion

File
subgraph0:D,C,B,F,A,E,
subgraph1:D,C,F,B,H,E,A,I,