MAPPR for local higher-order clustering

MAPPR code in SNAP

The code to MAPPR is in the latest version of of SNAP. See the examples/localmotifcluster directory for sample code. Here is an example of how to use the code:

# Download SNAP
git clone
# Build the code
cd snap/examples/localmotifcluster/
# Run the MAPPR example
./localmotifclustermain -d:Y -i:C-elegans-frontal.txt -m:FFLoop -s:1


Our implementation works for both directed and undirected networks By default it regards the input graph as undirected. To analyze the graph as a directed graph, use parameter "-d:Y".

Regarding naming convention of motifs (the "-m" parameter), for undirected graphs, we use "UEdge" for undirected edge, and "clique3", ..., "clique9" for cliques for sizes 3 through 9. For directed graph motifs, the naming convention is seen in the following table.

Directed graph motif naming conventions
M1 UniDE    
M2 BiDE      
M3 Cycle = M1 + M2 + M3 + 2*M4
M4 FFLoop = M5 + M6 + 2*M7
M5 Triad = M1 + ... + M7
M6 DE = UniDE + 2*BiDE
M7 Edge = UniDE + BiDE
Note that this naming convention is different from that in the KDD paper: in the paper, M1 represents triangles in any direction (Triad), M2 represents cycles (Cycle), and M3 represents feed-forward loops (FFLoop).

The "-s:" parameter is to specify seed node in the MAPPR method.