# tartaruszen/anets architecture

> Architecture diagram of the GitHub repository tartaruszen/anets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tartaruszen/anets
- Repository: https://github.com/tartaruszen/anets

## Overview

##### Project type and purpose
- This is an open-source research tool (ANets) for efficiently summarizing attributed diffusion networks.
- It provides a command-line interface (CLI) in Python that orchestrates calls to a C++ core library to perform graph summarization and segmentation in parallel.

##### File structure
- Top-level:
– README.md (project description & usage)
– code/ (all source and build logic)
– data/ (sample “disney” and “memetracker” graphs)
- code/:
– ANets.py, getEigenScore.py – Python entry points (CLI wrappers)
– makefile – build script for C++
– src/ – C++ implementation modules:
- CoarseNet.* – summary-graph generator
- DisjointSets.* – union-find data structure for segmentation
- Edge.*, graph.* – core graph representations & I/O
- data/:
– Two example datasets, each with features.txt and links.txt

##### README for additional insights
- Workflow:
1. make → compile C++ into binaries/lib
2. make demo → run toy example end-to-end
3. python ANets.py <data_path> <percent> <threads1> <threads2> → real run
- Inputs: raw link list + node attributes
- Outputs: summarized links.txt, features.txt, node_map.txt

##### Detail
- Every major folder and module: code/src, code/ANets.py, data/<dataset>
- Output files (links.txt, features.txt, node_map.txt) as part of the Data Layer

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "CLI Layer"
        ANets["ANets.py"]:::python
        getEigenScore["getEigenScore.py"]:::python
    end

    subgraph "Build Automation"
        Makefile["makefile"]:::build
    end

    subgraph "Compute Layer"
        CoarseNet["CoarseNet.cpp"]:::cpp
        DisjointSetsCPP["DisjointSets.cpp"]:::cpp
        DisjointSetsH["DisjointSets.h"]:::cpp
        EdgeCPP["Edge.cpp"]:::cpp
        EdgeH["Edge.h"]:::cpp
        GraphCPP["graph.cpp"]:::cpp
        GraphH["graph.h"]:::cpp
        Binary["C++ Binary"]:::component
    end

    subgraph "Data Layer"
        In1["features.txt (disney)"]:::data
        In2["links.txt (disney)"]:::data
        In3["features.txt (memetracker)"]:::data
        In4["links.txt (memetracker)"]:::data
        Out1["summary_links.txt"]:::data
        Out2["summary_features.txt"]:::data
        Out3["node_map.txt"]:::data
        Out4["eigen_scores.txt"]:::data
    end

    ANets -->|"calls make"| Makefile
    Makefile -->|"build"| Binary
    ANets -->|"spawn C++ binary"| Binary
    Binary -->|"read"| In1
    Binary -->|"read"| In2
    Binary -->|"read"| In3
    Binary -->|"read"| In4
    Binary -->|"run summarization (T1) & segmentation (T2)"| Binary
    Binary -->|"write"| Out1
    Binary -->|"write"| Out2
    Binary -->|"write"| Out3
    Binary -->|"return exit code"| ANets
    ANets -->|"invoke post-processing"| getEigenScore
    getEigenScore -->|"read"| Out1
    getEigenScore -->|"read"| Out2
    getEigenScore -->|"read"| Out3
    getEigenScore -->|"write"| Out4

    click ANets "https://github.com/tartaruszen/anets/blob/master/code/ANets.py"
    click getEigenScore "https://github.com/tartaruszen/anets/blob/master/code/getEigenScore.py"
    click Makefile "https://github.com/tartaruszen/anets/tree/master/code/makefile"
    click CoarseNet "https://github.com/tartaruszen/anets/blob/master/code/src/CoarseNet.cpp"
    click DisjointSetsCPP "https://github.com/tartaruszen/anets/blob/master/code/src/DisjointSets.cpp"
    click DisjointSetsH "https://github.com/tartaruszen/anets/blob/master/code/src/DisjointSets.h"
    click EdgeCPP "https://github.com/tartaruszen/anets/blob/master/code/src/Edge.cpp"
    click EdgeH "https://github.com/tartaruszen/anets/blob/master/code/src/Edge.h"
    click GraphCPP "https://github.com/tartaruszen/anets/blob/master/code/src/graph.cpp"
    click GraphH "https://github.com/tartaruszen/anets/blob/master/code/src/graph.h"
    click In1 "https://github.com/tartaruszen/anets/blob/master/data/disney/features.txt"
    click In2 "https://github.com/tartaruszen/anets/blob/master/data/disney/links.txt"
    click In3 "https://github.com/tartaruszen/anets/blob/master/data/memetracker/features.txt"
    click In4 "https://github.com/tartaruszen/anets/blob/master/data/memetracker/links.txt"

    classDef python fill:#f9e79f,stroke:#d35400,color:#000
    classDef build fill:#d6eaf8,stroke:#2980b9,color:#000
    classDef cpp fill:#d5f5e3,stroke:#27ae60,color:#000
    classDef component fill:#aed6f1,stroke:#2e86c1,color:#000
    classDef data fill:#d4efdf,stroke:#229954,color:#000
```
