# sipman/genetictimetable architecture

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

- Interactive diagram: https://gitdiagram.com/sipman/genetictimetable
- Repository: https://github.com/sipman/genetictimetable

## Overview

##### Project Type Analysis
This is a specialized algorithmic application that uses genetic algorithms to solve the school timetable scheduling problem. It's implemented in C and appears to be a standalone application with distinct functional modules.

##### Main Components

Core Components:
a) Input Processing Layer
- fileParse.c (Data input and parsing)
- headers.c (Structure definitions and configurations)

b) Genetic Algorithm Engine
- genetics.c (Core genetic algorithm implementation)
- Individual and population management

c) Schedule Management
- scheduleControl.c (Schedule manipulation and validation)
- lectureControl.c (Lecture management)

d) Output Handling
- print.c (Output generation and formatting)

e) Testing Component
- tests.c (Validation and testing framework)

**[Input Layer] → [Genetic Algorithm Core] → [Schedule Management] → [Output Layer]**
- ↑               ↕                           ↕                    ↓
**[Data Files] → [Population Management] ← [Lecture Control]    [Generated Timetable]**
- ↑
- [Testing Framework]

##### Component Details

- struct class
- struct datetime
- struct individual
- struct lecture
- struct params
- struct room
- struct subject
- struct teacher
- struct timetable

##### Process Flow Indicators
- Genetic algorithm iteration loops
- Validation checkpoints
- Optimization feedback paths

##### Key Relationships to Highlight
- Data flow between parser and genetic algorithm
- Population evolution cycles
- Schedule validation and optimization paths
- Output generation process

##### Technical Details
- File formats (dat.sched) as input sources
- Configuration points
- Testing integration points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        IF[Input Files]
        DS["dat.sched"]
        FP["File Parser"]
        HD["Header Definitions"]
    end

    subgraph "Genetic Algorithm Core"
        GA["Genetic Algorithm Engine"]
        PM["Population Management"]
        
        subgraph "Data Structures"
            direction TB
            DS1["struct class"]
            DS2["struct datetime"]
            DS3["struct individual"]
            DS4["struct lecture"]
            DS5["struct params"]
            DS6["struct room"]
            DS7["struct subject"]
            DS8["struct teacher"]
            DS9["struct timetable"]
        end
    end

    subgraph "Schedule Management"
        SC["Schedule Control"]
        LC["Lecture Control"]
    end

    subgraph "Output & Testing"
        OP["Output Printer"]
        TF["Testing Framework"]
        GT["Generated Timetable"]
    end

    IF --> FP
    DS --> FP
    FP --> GA
    HD --> GA
    GA <--> PM
    PM --> SC
    SC <--> LC
    SC --> OP
    LC --> OP
    OP --> GT
    TF --> PM
    
    %% Data Structure Relationships
    DS1 & DS2 & DS3 & DS4 & DS5 & DS6 & DS7 & DS8 & DS9 --> PM

    %% Component Mappings
    click FP "https://github.com/sipman/geneticTimeTable/blob/master/fileParse.c"
    click HD "https://github.com/sipman/geneticTimeTable/blob/master/headers.c"
    click GA "https://github.com/sipman/geneticTimeTable/blob/master/genetics.c"
    click SC "https://github.com/sipman/geneticTimeTable/blob/master/scheduleControl.c"
    click LC "https://github.com/sipman/geneticTimeTable/blob/master/lectureControl.c"
    click OP "https://github.com/sipman/geneticTimeTable/blob/master/print.c"
    click TF "https://github.com/sipman/geneticTimeTable/blob/master/tests.c"
    click DS "https://github.com/sipman/geneticTimeTable/blob/master/dat.sched"

    %% Styling
    classDef input fill:#a8d1ff
    classDef genetic fill:#90EE90
    classDef schedule fill:#FFB366
    classDef output fill:#d3d3d3
    classDef datastructure fill:#FFE4B5

    class IF,FP,HD,DS input
    class GA,PM genetic
    class SC,LC schedule
    class OP,TF,GT output
    class DS1,DS2,DS3,DS4,DS5,DS6,DS7,DS8,DS9 datastructure
```
