# ssmele/antcolonyoptimization architecture

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

- Interactive diagram: https://gitdiagram.com/ssmele/antcolonyoptimization
- Repository: https://github.com/ssmele/antcolonyoptimization

## Overview

##### Main Components

a. Input Layer:
- TSP Dataset Input (specifically highlight oliver30 dataset)
- Algorithm Parameters Input (α, β, ρ, etc.)

b. ACO Core Components:
- Pheromone Matrix Manager
- Ant Colony Manager
- Path Construction Module
- Pheromone Update Module
- Solution Evaluation Module

c. Output Layer:
- Optimal Path Representation
- Performance Metrics
- Visualization Components

##### Component Relationships

- Dataset → Path Construction
- Pheromone Matrix → Path Construction
- Path Construction → Solution Evaluation
- Solution Evaluation → Pheromone Update
- Pheromone Update → Pheromone Matrix

##### Specific Design Elements

- Blue: Input components
- Green: Processing components
- Orange: Output/Visualization components
- Purple: Data storage components (pheromone matrix)

- Rectangles: Processing modules
- Parallelograms: Input/Output data
- Diamonds: Decision points

##### Implementation Details to Highlight

- Pheromone evaporation rate (ρ)
- Pheromone importance (α)
- Heuristic importance (β)
- Number of ants
- Maximum iterations

##### Iterative Process Visualization

- Ant Path Construction
- Solution Evaluation
- Pheromone Update
- Convergence Check

##### Additional Elements

- Solution quality indicators
- Convergence metrics
- Performance measurements

## Diagram (Mermaid)

```mermaid
graph TB
    %% Input Layer
    subgraph Input
        TSP[("TSP Dataset<br/>(oliver30)")]:::input
        Params["Algorithm Parameters<br/>α, β, ρ"]:::input
    end

    %% ACO Core Components
    subgraph ACO["ACO Core System"]
        PheromoneMatrix[("Pheromone Matrix")]:::storage
        AntColony["Ant Colony Manager"]:::process
        PathConstruction["Path Construction<br/>Module"]:::process
        SolutionEval["Solution Evaluation<br/>Module"]:::process
        PheromoneUpdate["Pheromone Update<br/>Module"]:::process
    end

    %% Output Layer
    subgraph Output
        OptPath["Optimal Path<br/>Representation"]:::output
        Metrics["Performance<br/>Metrics"]:::output
        Viz["Visualization<br/>Components"]:::output
    end

    %% Technical Notes
    subgraph Notes["Technical Implementation"]
        Implementation["Python/Jupyter<br/>Implementation"]:::note
        Dataset["Dataset Format<br/>Requirements"]:::note
        Performance["Performance<br/>Considerations"]:::note
    end

    %% Relationships
    TSP --> PathConstruction
    Params --> AntColony
    AntColony --> PathConstruction
    PheromoneMatrix --> PathConstruction
    PathConstruction --> SolutionEval
    SolutionEval --> PheromoneUpdate
    PheromoneUpdate -.-> PheromoneMatrix
    SolutionEval --> OptPath
    SolutionEval --> Metrics
    OptPath --> Viz

    %% Legend
    subgraph Legend
        L1["Process"]:::process
        L2[("Storage")]:::storage
        L3["Input"]:::input
        L4["Output"]:::output
        L5["Notes"]:::note
    end

    %% Click Events
    click Implementation "https://github.com/ssmele/AntColonyOptimization/blob/main/ACO.ipynb"
    click Notes "https://github.com/ssmele/AntColonyOptimization/blob/main/AntSystem_ApplicationToTSP.pdf"
    click ACO "https://github.com/ssmele/AntColonyOptimization/blob/main/README.md"

    %% Styles
    classDef process fill:#90EE90,stroke:#333,stroke-width:2px
    classDef storage fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef input fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef output fill:#FFA07A,stroke:#333,stroke-width:2px
    classDef note fill:#F0E68C,stroke:#333,stroke-width:2px
```
