# ern1/ai-algorithms architecture

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

- Interactive diagram: https://gitdiagram.com/ern1/ai-algorithms
- Repository: https://github.com/ern1/ai-algorithms

## Overview

##### Project Type Analysis
This is a collection of AI algorithm implementations, including:
- Search algorithms (Best-first, Depth-first)
- Game theory (Adversarial Search/Minimax)
- Machine Learning (Neural Networks)
- Evolutionary Computation (Genetic Algorithms, Differential Evolution, Particle Swarm)

**[Search Algorithms] [Game Theory] [Neural Networks] [Evolutionary Computation]**

##### Search Algorithms Section
- Best-first Search (A* and Greedy implementations)
- Depth-first Search (Sudoku Solver application)
- Data flow showing how these algorithms interact with their input data (cities_map, sudoku puzzles)

##### Game Theory Section
- Minimax algorithm implementation
- Game tree structure and decision flow

##### Neural Networks Section
- ANN architecture with:
- Core Neural Network (ann.py)
- Utilities (ann_util.py)
- Testing Component (test_ann.py)
- Data flow for MNIST dataset training

##### Evolutionary Computation Section
- Parallel implementation of:
- Genetic Algorithm
- Differential Evolution
- Particle Swarm Optimization
- Test cases and optimization problems (berlin52)

c. Visual Elements:

Use these specific visual elements:
- Blue rectangles for algorithm implementations
- Green diamonds for data inputs/datasets
- Orange hexagons for testing components
- Double lines for inheritance relationships

d. Detailed Instructions:

- [Master Container: AI Algorithms]

- [Search Algorithms]
- [Best-first Search]
- [Depth-first Search]

- [Game Theory]
- [Minimax]

- [Neural Networks]
- [Core ANN]
- [Utils]
- [Testing]

- [Evolutionary Computation]
- [Genetic Algorithm]
- [Differential Evolution]
- [Particle Swarm]

##### For each algorithm section
- Input/output relationships
- Data dependencies
- Test components
- File relationships

##### Implementation details
- Programming language indicators
- File references
- Dataset connections
- Testing frameworks

Key Considerations:

##### Relationships
- How testing components verify each algorithm
- Shared utilities or common patterns
- Data flow between components

##### Technical Details
- File names in small text
- Primary interfaces
- Where external data is used

##### Documentation
- Notes for complex relationships
- Version information
- Reference relevant academic papers or sources

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Categories
    subgraph AI["AI Algorithms"]
        direction TB
        
        subgraph Search["Search Algorithms"]
            direction TB
            BFS["Best-first Search"]:::algorithm
            DFS["Depth-first Search"]:::algorithm
            
            BFSImpl["A* and Greedy Implementation"]:::implementation
            BFSData["Cities Map Data"]:::data
            DFSImpl["Sudoku Solver"]:::implementation
            DFSData["Sudoku Puzzles"]:::data
            
            BFS --> BFSImpl
            BFSImpl --> BFSData
            DFS --> DFSImpl
            DFSImpl --> DFSData
        end
        
        subgraph Game["Game Theory"]
            direction TB
            Minimax["Minimax Algorithm"]:::algorithm
            GameTree["Game Tree Structure"]:::implementation
            
            Minimax --> GameTree
        end
        
        subgraph Neural["Neural Networks"]
            direction TB
            ANN["Core Neural Network"]:::implementation
            ANNUtil["Utilities"]:::implementation
            ANNTest["Testing Component"]:::testing
            MNIST["MNIST Dataset"]:::data
            
            ANN --> ANNUtil
            ANN --> ANNTest
            ANNTest --> MNIST
        end
        
        subgraph Evo["Evolutionary Computation"]
            direction TB
            GA["Genetic Algorithm"]:::algorithm
            DE["Differential Evolution"]:::algorithm
            PSO["Particle Swarm"]:::algorithm
            
            GAImpl["GA Implementation"]:::implementation
            GAData["Berlin52 Dataset"]:::data
            DETest["DE Testing"]:::testing
            GATest["GA Testing"]:::testing
            PSOTest["PSO Testing"]:::testing
            
            GA --> GAImpl
            GAImpl --> GAData
            DE --> DETest
            GA --> GATest
            PSO --> PSOTest
        end
    end
    
    %% Styling
    classDef algorithm fill:#a8d5ff,stroke:#333
    classDef implementation fill:#95ff95,stroke:#333
    classDef data fill:#ffd700,stroke:#333
    classDef testing fill:#ffa07a,stroke:#333
    
    %% Click Events
    click BFSImpl "https://github.com/ern1/AI-algorithms/blob/master/Best_first_search/aStar_greedy.py"
    click BFSData "https://github.com/ern1/AI-algorithms/tree/master/Best_first_search/cities_map"
    click DFSImpl "https://github.com/ern1/AI-algorithms/blob/master/Depth_first_search-Sudoku_solver/sudoku_dfs.py"
    click DFSData "https://github.com/ern1/AI-algorithms/tree/master/Depth_first_search-Sudoku_solver/sudoku"
    click Minimax "https://github.com/ern1/AI-algorithms/blob/master/Adversial_Search/minimax.py"
    click ANN "https://github.com/ern1/AI-algorithms/blob/master/Artifical_Neural_Network/ann.py"
    click ANNUtil "https://github.com/ern1/AI-algorithms/blob/master/Artifical_Neural_Network/ann_util.py"
    click ANNTest "https://github.com/ern1/AI-algorithms/blob/master/Artifical_Neural_Network/test_ann.py"
    click MNIST "https://github.com/ern1/AI-algorithms/blob/master/Artifical_Neural_Network/mnist_train.csv"
    click GAImpl "https://github.com/ern1/AI-algorithms/blob/master/Genetic_Algorithm/ga.py"
    click GAData "https://github.com/ern1/AI-algorithms/tree/master/Genetic_Algorithm/berlin52"
    click DETest "https://github.com/ern1/AI-algorithms/blob/master/Evolutionary_Algorithms/test-differential_evolution.m"
    click GATest "https://github.com/ern1/AI-algorithms/blob/master/Evolutionary_Algorithms/test-genetic_algorithm.m"
    click PSOTest "https://github.com/ern1/AI-algorithms/blob/master/Evolutionary_Algorithms/test-particle_swarm_optimization.m"
```
