# dkomni/genetic-algorithm-scheduling architecture

> Architecture diagram of the GitHub repository dkomni/genetic-algorithm-scheduling, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dkomni/genetic-algorithm-scheduling
- Repository: https://github.com/dkomni/genetic-algorithm-scheduling

## Overview

This Java command-line application searches for a feasible, low-penalty 30-employee, 14-day shift schedule. The principal workflow is parameter input, feasible population generation, repeated selection and variation, penalty evaluation, and termination with a printed schedule. The graph separates hard-constraint validation from soft-constraint scoring; both are implemented in Fitness.java. The README documents additional operators and tuning options, while the sampled source confirms the active rank selection, uniform crossover, and random mutation path.

Main entry points: [`GA_main.java`](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java) (GA entry point), [`Population.java`](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Population.java) (Population), [`Individual.java`](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Individual.java) (Schedule individual), [`Fitness.java`](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Fitness.java) (Hard validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run and evolution"]
  node_main["GA entry point<br/>[GA_main.java]"]
  node_selection["Rank selection<br/>[GA_main.java]"]
  node_crossover["Uniform crossover<br/>[GA_main.java]"]
  node_mutation["Random mutation<br/>[GA_main.java]"]
  node_result["Printed schedule<br/>[GA_main.java]"]
end

subgraph group_model["Schedule model"]
  node_population["Population<br/>[Population.java]"]
  node_individual["Schedule individual<br/>[Individual.java]"]
end

subgraph group_evaluation["Constraint evaluation"]
  node_validity["Hard validation<br/>[Fitness.java]"]
  node_scoring["Penalty scoring<br/>[Fitness.java]"]
end

node_user(("Operator"))

node_user -->|"provides parameters"| node_main
node_main -->|"creates and initializes"| node_population
node_population -->|"creates schedules"| node_individual
node_population -->|"checks feasibility"| node_validity
node_main -->|"scores individuals"| node_scoring
node_main -->|"selects parents"| node_selection
node_selection -->|"reads candidates"| node_population
node_main -->|"combines parents"| node_crossover
node_main -->|"mutates offspring"| node_mutation
node_mutation -->|"regenerates gene"| node_individual
node_main -->|"builds next generation"| node_population
node_main -->|"prints best schedule"| node_result

click node_main "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java"
click node_population "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Population.java"
click node_individual "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Individual.java"
click node_validity "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Fitness.java"
click node_scoring "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Fitness.java"
click node_selection "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java"
click node_crossover "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java"
click node_mutation "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java"
click node_result "https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java"

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_main,node_selection,node_crossover,node_mutation,node_result toneBlue
class node_population,node_individual toneAmber
class node_validity,node_scoring toneMint
class node_user toneIndigo
```

## Components

### Run and evolution

- [GA entry point](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java): `GA_main.java`
- [Rank selection](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java): `GA_main.java`
- [Uniform crossover](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java): `GA_main.java`
- [Random mutation](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java): `GA_main.java`
- [Printed schedule](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/GA_main.java): `GA_main.java`

### Schedule model

- [Population](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Population.java): `Population.java`
- [Schedule individual](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Individual.java): `Individual.java`

### Constraint evaluation

- [Hard validation](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Fitness.java): `Fitness.java`
- [Penalty scoring](https://github.com/dkomni/genetic-algorithm-scheduling/blob/main/Fitness.java): `Fitness.java`

### Other components

- **Operator**

## Connections

- Operator → GA entry point: provides parameters
- GA entry point → Population: creates and initializes
- Population → Schedule individual: creates schedules
- Population → Hard validation: checks feasibility
- GA entry point → Penalty scoring: scores individuals
- GA entry point → Rank selection: selects parents
- Rank selection → Population: reads candidates
- GA entry point → Uniform crossover: combines parents
- GA entry point → Random mutation: mutates offspring
- Random mutation → Schedule individual: regenerates gene
- GA entry point → Population: builds next generation
- GA entry point → Printed schedule: prints best schedule
