# kobong8/classiccomputerscienceproblemsinpython architecture

> Architecture diagram of the GitHub repository kobong8/classiccomputerscienceproblemsinpython, 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/kobong8/classiccomputerscienceproblemsinpython
- Repository: https://github.com/kobong8/classiccomputerscienceproblemsinpython

## Overview

##### Project type and purpose
- This repository is an open-source educational tool: a collection of classic computer-science problem implementations in Python.
- It organizes algorithm examples, exercises, and tests following the structure of the book “Classic Computer Science Problems in Python.”

##### File structure
- Top-level:
- README.md
- Chapter01, Chapter02, …, Chapter09 directories
- Within each ChapterXX: year-stamped subdirectories (e.g., 2020, 2022, 2024), each containing “Example,” “Exercise,” and sometimes “TEST” folders or data assets (CSV, HDF5).
- Patterns: each chapter is effectively a self-contained Python package (no __init__.py, but logically grouped).
- Data directories hold datasets (iris.csv, wine.csv, sudoku boards, etc.).
- No central “core” service—each module stands alone, but all follow the same naming and folder conventions.

##### README for additional insights
- Describes code origins, book reference, and links to two visualizations: the Sudoku solver and MST priority-queue animation.
- Implies no overarching framework—this is a code catalog.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Consumers
    Students["Students / Educators"]:::consumer
    Students -->|"import algorithms"| Repo["Repository Root"]

    subgraph "Repository Root"
        direction TB

        subgraph "Chapter01" 
            direction TB
            C01_Example2020["Example (2020)"]:::example
            C01_Exercise2020["Exercise (2020)"]:::exercise
            C01_Exercise2020 -->|"references"| C01_Example2020
        end

        subgraph "Chapter02"
            direction TB
            C02_Example2020["Example (2020)"]:::example
            C02_Exercise2020["Exercise (2020)"]:::exercise
            C02_Exercise2020 -->|"references"| C02_Example2020
        end

        subgraph "Chapter03"
            direction TB
            C03_Example2020["CSP Examples (2020)"]:::example
            C03_Exercise2020["Sudoku Exercises (2020)"]:::exercise
            C03_Exercise2020 -->|"uses CSP code"| C03_Example2020

            subgraph "ProjectSudoku (2022)"
                direction TB
                Sudoku_Visualizer["Visualizer & Solver"]:::example
                Tensorflow["TensorFlow Submodule"]:::example
                Sudoku_Visualizer -->|"calls"| Tensorflow
                C03_Exercise2020 -->|"drives"| Sudoku_Visualizer
            end
        end

        subgraph "Chapter04"
            direction TB
            C04_Example2020["Example (2020)"]:::example
            C04_Exercise2020["Exercise (2020)"]:::exercise
            C04_Exercise2020 -->|"references"| C04_Example2020

            Mst_Vis["MST & Priority-Queue Visualization (2022)"]:::example
            C04_Exercise2020 -->|"demonstrates"| Mst_Vis
        end

        subgraph "Chapter05"
            direction TB
            C05_Example2020["Example (2020)"]:::example
            C05_Exercise2020["Exercise (2020)"]:::exercise
            C05_Exercise2020 -->|"references"| C05_Example2020
        end

        subgraph "Chapter06"
            direction TB
            C06_Example2020["Example (2020)"]:::example
            C06_Exercise2020["Exercise (2020)"]:::exercise
            C06_Exercise2020 -->|"references"| C06_Example2020
        end

        subgraph "Chapter07"
            direction TB
            C07_Example["Neural-Net Examples"]:::example
            C07_Exercise_NN_NP["NumPy NN Exercise"]:::exercise
            C07_Exercise_NN_PT["PyTorch NN Exercise"]:::exercise
            C07_Exercise_NN_NP -->|"uses data"| Iris_Data
            C07_Exercise_NN_PT -->|"uses data"| Wine_Data
            C07_Example -->|"loads data"| Iris_Data
            C07_Example -->|"loads data"| Wine_Data
            class Iris_Data,Wine_Data data
        end

        subgraph "Chapter08"
            direction TB
            C08_Examples2020["Game AI Examples (2020)"]:::example
            C08_Examples2024["Updated Examples (2024)"]:::example
        end

        subgraph "Chapter09"
            direction TB
            Knapsack["knapsack.py"]:::example
            PhoneMnemonics["phone_number_mnemonics.py"]:::example
            TSP["tsp.py"]:::example
        end
    end

    %% Data Resources
    Iris_Data["iris.csv"]:::data
    Wine_Data["wine.csv"]:::data

    %% Click Events
    click Repo "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/./"
    click C01_Example2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter01/2020/Example"
    click C01_Exercise2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter01/2020/Exercise"
    click C02_Example2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter02/2020/Example"
    click C02_Exercise2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter02/2020/Exercise"
    click C03_Example2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter03/2020/Example"
    click C03_Exercise2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter03/2020/Exercise"
    click Sudoku_Visualizer "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter03/2022/ProjectSudoku"
    click Tensorflow "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter03/2022/ProjectSudoku/tensorflow"
    click C04_Example2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter04/2020/Example"
    click C04_Exercise2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter04/2020/Exercise"
    click Mst_Vis "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter04/2022/msa_mst_visualization"
    click C05_Example2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter05/2020/Example"
    click C05_Exercise2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter05/2020/Exercise"
    click C06_Example2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter06/2020/Example"
    click C06_Exercise2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter06/2020/Exercise"
    click C07_Example "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter07/Example"
    click C07_Exercise_NN_NP "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter07/Exercise/nn_numpy"
    click C07_Exercise_NN_PT "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter07/Exercise/nn_pytorch"
    click Iris_Data "https://github.com/kobong8/classiccomputerscienceproblemsinpython/blob/main/Chapter07/Example/iris.csv"
    click Wine_Data "https://github.com/kobong8/classiccomputerscienceproblemsinpython/blob/main/Chapter07/Example/wine.csv"
    click C08_Examples2020 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter08/2020"
    click C08_Examples2024 "https://github.com/kobong8/classiccomputerscienceproblemsinpython/tree/main/Chapter08/2024/Example"
    click Knapsack "https://github.com/kobong8/classiccomputerscienceproblemsinpython/blob/main/Chapter09/knapsack.py"
    click PhoneMnemonics "https://github.com/kobong8/classiccomputerscienceproblemsinpython/blob/main/Chapter09/phone_number_mnemonics.py"
    click TSP "https://github.com/kobong8/classiccomputerscienceproblemsinpython/blob/main/Chapter09/tsp.py"

    %% Styles
    classDef example fill:#ADD8E6,stroke:#000;
    classDef exercise fill:#90EE90,stroke:#000;
    classDef test fill:#FFA500,stroke:#000;
    classDef data fill:#F0E68C,stroke:#000,shape:cylinder;
    classDef consumer shape:stick,fill:#FFB6C1,stroke:#000;
```
