Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

Commit 6eeab81

Browse files
feat: Graph Motif Analyzer — detect and count subgraph patterns
Add MotifAnalyzer for network motif analysis: Detected motifs: - Triangles (3-cliques) with density and clustering coefficient - Squares (4-cycles) via common-neighbor counting - k-Stars (3/4/5-stars) via combinatorial degree counting - Wedges (open triads) and open paths (P3) Derived metrics: - Global clustering coefficient (3 * triangles / wedges) - Triangle density (triangles / C(n,3)) - Transitivity ratio (closed triads / total triads) - Per-vertex motif participation counts - Normalized motif fingerprint vector for cross-graph comparison - Top participants ranking per motif type Usage: MotifAnalyzer ma = new MotifAnalyzer(graph).compute(); System.out.println(ma.getTriangleCount()); System.out.println(ma.getClusteringCoefficient()); System.out.println(ma.getSummary()); 41 new tests, all pass.
1 parent 4e53c82 commit 6eeab81

2 files changed

Lines changed: 1053 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)