# adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach architecture

> Architecture diagram of the GitHub repository adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach
- Repository: https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach

## Overview

##### Project type and purpose
- This is an open-source research tool (CLI application) for fair submodular subset selection via Pareto optimization.
- The README title and filenames (run_mc_*, run_rs_*, data folders) show it’s geared toward running different submodular algorithms on various datasets and producing result files.

##### File structure
- Top-level “run_*.py” scripts: entry points for experiments (Monte Carlo (MC) and Randomized Swap (RS) methods on different constraints).
- algos/: core algorithm implementations that operate on data matrices.
- handlers/: classes (Handler.py, HandlerMC.py, HandlerRS.py, etc.) that orchestrate an experiment: loading data, invoking the right algorithm, collecting metrics.
- tools/: shared utilities (e.g. data preprocessing, logging).
- data/: raw and preprocessed datasets (dblp, facebook, wine, ml), in CSV/pickle form.
- results/: output directory where each run script dumps its CSV results.

##### README for additional insights
- The README is minimal; it confirms “All data and software.” We infer that the primary architecture emerges from the folder layout and script naming.

##### Elements
- From Runner → Handler
- Handler → Data Store (read)
- Handler → algos module
- algos → Handler (return results)
- Handler → Results Store (write)
- Handler ↔ Tools (utilities calls)
- Rectangles for code modules (handlers/, algos/, tools/)
- Rounded rectangles for scripts (run_*.py entry points)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Storage
    DataStore(("Data Storage")):::storage
    click DataStore "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/tree/main/data/"

    %% CLI Runner Scripts
    subgraph "CLI Runner Scripts"
        direction TB
        Run1["run_mc_KNAPSACK_rep_as_COVERAGE.py"]:::script
        Run2["run_mc_MATROIDS_rep_as_COVERAGE.py"]:::script
        Run3["run_mc__COST_3__KNA.py"]:::script
        Run4["run_mc__COST_3__MAT.py"]:::script
        Run5["run_rs_KNAPSACK.py"]:::script
        Run6["run_rs_MATROIDS.py"]:::script
        Run7["run_rs__COST_3__KNA.py"]:::script
        Run8["run_rs__COST_3__MAT.py"]:::script
    end
    click Run1 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/run_mc_KNAPSACK_rep_as_COVERAGE.py"
    click Run2 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/run_mc_MATROIDS_rep_as_COVERAGE.py"
    click Run3 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/run_mc__COST_3__KNA.py"
    click Run4 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/run_mc__COST_3__MAT.py"
    click Run5 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/run_rs_KNAPSACK.py"
    click Run6 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/run_rs_MATROIDS.py"
    click Run7 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/run_rs__COST_3__KNA.py"
    click Run8 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/run_rs__COST_3__MAT.py"

    %% Experiment Handlers
    subgraph "Experiment Handlers"
        direction TB
        H1["Handler.py"]:::handler
        H2["HandlerMC.py"]:::handler
        H3["HandlerMCRepAsCov.py"]:::handler
        H4["HandlerMCRepAsCovPartitionMatroids.py"]:::handler
        H5["HandlerRS.py"]:::handler
        H6["HandlerRSinnerProduct.py"]:::handler
        H7["HandlerRSinnerProductPartitionMatroids.py"]:::handler
    end
    click H1 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/handlers/Handler.py"
    click H2 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/handlers/HandlerMC.py"
    click H3 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/handlers/HandlerMCRepAsCov.py"
    click H4 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/handlers/HandlerMCRepAsCovPartitionMatroids.py"
    click H5 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/handlers/HandlerRS.py"
    click H6 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/handlers/HandlerRSinnerProduct.py"
    click H7 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/handlers/HandlerRSinnerProductPartitionMatroids.py"

    %% Algorithm Core
    subgraph "Algorithm Core"
        direction TB
        Alg["algos.py"]:::core
    end
    click Alg "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/algos/algos.py"

    %% Utility Toolkit
    subgraph "Utility Toolkit"
        direction TB
        Tools["tools.py"]:::tool
    end
    click Tools "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/tools/tools.py"

    %% Results Output
    subgraph "Results Output"
        direction TB
        R1(("MC_medium/")):::storage
        R2(("MC_small/")):::storage
        R3(("RS_small/")):::storage
        R4(("dummy.csv")):::storage
    end
    click R1 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/tree/main/results/MC_medium/"
    click R2 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/tree/main/results/MC_small/"
    click R3 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/tree/main/results/RS_small/"
    click R4 "https://github.com/adrianfaz/fair-representation-in-submodular-subset-selection-a-pareto-optimization-approach/blob/main/results/dummy.csv"

    %% Connections
    Run1 -->|instantiates| H1
    Run2 -->|instantiates| H1
    Run3 -->|instantiates| H1
    Run4 -->|instantiates| H1
    Run5 -->|instantiates| H1
    Run6 -->|instantiates| H1
    Run7 -->|instantiates| H1
    Run8 -->|instantiates| H1

    H1 -->|"loads data"| DataStore
    H1 -->|"calls algorithm"| Alg
    Alg -->|"returns results"| H1
    H1 -->|"writes results"| R1
    H1 -->|"writes results"| R2
    H1 -->|"writes results"| R3
    H1 -->|"writes results"| R4
    H1 -->|"uses utilities"| Tools

    %% Styles
    classDef storage fill:#FFD580,stroke:#D2691E,stroke-width:2px;
    classDef script fill:#A9D0F5,stroke:#2E64FE,stroke-width:2px,stroke-dasharray: 5 5;
    classDef handler fill:#F5A9BC,stroke:#FE2E64,stroke-width:2px;
    classDef core fill:#BEF781,stroke:#64FE2E,stroke-width:2px;
    classDef tool fill:#F2F5A9,stroke:#D8DF07,stroke-width:2px;
```
