# falihsmara80-dot/high-performance-symnmf-clustering-engine architecture

> Architecture diagram of the GitHub repository falihsmara80-dot/high-performance-symnmf-clustering-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/falihsmara80-dot/high-performance-symnmf-clustering-engine
- Repository: https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine

## Overview

This repository provides command-line SymNMF matrix operations and clustering, plus a separate K-means implementation and a comparison script. The main workflow loads data in `symnmf.py`, builds similarity and normalized matrices through the native Python extension, and runs the C SymNMF update; `analysis.py` compares resulting labels with K-means using silhouette scores. The README also describes spectral initialization and acceleration/sparse capabilities, but the excerpts do not show their implementation, so they are not mapped as runtime components.

Main entry points: [`analysis.py`](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/analysis.py) (Comparison runner), [`symnmf.py`](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.py) (SymNMF CLI), [`symnmfmodule.c`](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmfmodule.c) (Python bindings), [`symnmf.c`](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.c) (Matrix operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_python["Python workflows"]
  node_symnmf_cli["SymNMF CLI<br/>[symnmf.py]"]
  node_data_loader["Input loader<br/>[symnmf.py]"]
  node_matrix_workflow["Matrix workflow<br/>[symnmf.py]"]
end

subgraph group_native["Native engine"]
  node_extension["Python bindings<br/>[symnmfmodule.c]"]
  node_matrix_core["Matrix operations<br/>[symnmf.c]"]
  node_symnmf_update["SymNMF update<br/>[symnmf.c]"]
end

subgraph group_evaluation["Evaluation"]
  node_analysis["Comparison runner<br/>[analysis.py]"]
  node_kmeans["K-means clustering<br/>[kmeans.py]"]
  node_silhouette["Silhouette scoring<br/>[analysis.py]"]
end

node_user(("CLI user"))

node_user -->|"runs"| node_symnmf_cli
node_symnmf_cli -->|"loads data"| node_data_loader
node_symnmf_cli -->|"dispatches goal"| node_matrix_workflow
node_matrix_workflow -->|"calls bindings"| node_extension
node_extension -->|"calls matrix routines"| node_matrix_core
node_extension -->|"calls update"| node_symnmf_update
node_user -->|"runs comparison"| node_analysis
node_analysis -->|"calls SymNMF"| node_matrix_workflow
node_analysis -->|"gets labels"| node_kmeans
node_analysis -->|"scores labels"| node_silhouette

click node_symnmf_cli "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.py"
click node_data_loader "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.py"
click node_matrix_workflow "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.py"
click node_extension "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmfmodule.c"
click node_matrix_core "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.c"
click node_symnmf_update "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.c"
click node_analysis "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/analysis.py"
click node_kmeans "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/kmeans.py"
click node_silhouette "https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/analysis.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_symnmf_cli,node_data_loader,node_matrix_workflow,node_user toneBlue
class node_extension,node_matrix_core,node_symnmf_update toneAmber
class node_analysis,node_kmeans,node_silhouette toneMint
```

## Components

### Python workflows

- [SymNMF CLI](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.py): `symnmf.py`
- [Input loader](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.py): `symnmf.py`
- [Matrix workflow](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.py): `symnmf.py`

### Native engine

- [Python bindings](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmfmodule.c): `symnmfmodule.c`
- [Matrix operations](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.c): `symnmf.c`
- [SymNMF update](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/symnmf.c): `symnmf.c`

### Evaluation

- [Comparison runner](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/analysis.py): `analysis.py`
- [K-means clustering](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/kmeans.py): `kmeans.py`
- [Silhouette scoring](https://github.com/falihsmara80-dot/high-performance-symnmf-clustering-engine/blob/main/analysis.py): `analysis.py`

### Other components

- **CLI user**

## Connections

- CLI user → SymNMF CLI: runs (evidence: `symnmf.py`)
- SymNMF CLI → Input loader: loads data (evidence: `symnmf.py`)
- SymNMF CLI → Matrix workflow: dispatches goal (evidence: `symnmf.py`)
- Matrix workflow → Python bindings: calls bindings (evidence: `symnmf.py`)
- Python bindings → Matrix operations: calls matrix routines (evidence: `symnmfmodule.c`)
- Python bindings → SymNMF update: calls update (evidence: `symnmfmodule.c`)
- CLI user → Comparison runner: runs comparison (evidence: `analysis.py`)
- Comparison runner → Matrix workflow: calls SymNMF (evidence: `analysis.py`)
- Comparison runner → K-means clustering: gets labels (evidence: `analysis.py`)
- Comparison runner → Silhouette scoring: scores labels (evidence: `analysis.py`)
