# philippschoen/tree-search-visualization architecture

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

- Interactive diagram: https://gitdiagram.com/philippschoen/tree-search-visualization
- Repository: https://github.com/philippschoen/tree-search-visualization

## Overview

##### Main Components

A. Frontend Layer (Angular Application)
- Search Problem Module
- Coordinate System Component
- Maze Component
- Problem Entities
- Search Tree Module
- Graph Visualization Components
- Tree Entities

B. Core Algorithm Layer
- Search Problems Implementation
- Eight Puzzle Problem
- Location Problem
- Maze Problem
- Pathfinding Problem
- Tree Search Algorithms
- A* Search
- Bidirectional Search
- Breadth-First Search
- Depth-First Search
- Depth-Limited Search
- Greedy Best-First Search
- Uniform Cost Search

##### Specific Elements

Frontend Layer:
**[App Component]**

- [Search Problem Component]
- [Coordinate System Component]
- [Maze Component]

- [Search Tree Component]
- [Graph Visualization]

Problem Domain:
**[Search Problem Interface]**

- [Eight Puzzle Problem]
- [Location Problem]
- [Maze Problem]
- [Pathfinding Problem]

Algorithm Layer:
**[Search Agent]**

- [Informed Search]
- [A* Search]
- [Greedy Best-First]

- [Uninformed Search]
- [BFS]
- [DFS]
- [Uniform Cost]

##### Important Architectural Patterns to Highlight

- Component-based architecture (Angular)
- Strategy pattern for different search algorithms
- Observer pattern for visualization updates
- Factory pattern for problem creation
- State pattern for problem states

##### Key Interactions

- User input → Problem state updates
- Algorithm execution → Tree generation
- Tree updates → Visualization refresh
- Problem state changes → UI updates

##### Technical Details

- Angular framework (v16+)
- TypeScript implementation
- Jest testing framework
- GitHub Pages deployment

- Component types (UI, logic, algorithm)
- State management flow

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef problem fill:#2ecc71,stroke:#27ae60,color:white
    classDef algorithm fill:#e67e22,stroke:#d35400,color:white
    classDef interface fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Frontend Layer
    subgraph Frontend
        AppComponent["App Component"]
        
        subgraph SearchProblemModule["Search Problem Module"]
            CoordSystem["Coordinate System Component"]
            MazeComp["Maze Component"]
        end
        
        subgraph SearchTreeModule["Search Tree Module"]
            GraphViz["Graph Visualization"]
            TreeEntities["Tree Entities"]
        end
    end

    %% Problem Domain Layer
    subgraph ProblemDomain["Problem Domain"]
        SearchProblemInterface["Search Problem Interface"]
        EightPuzzle["Eight Puzzle Problem"]
        Location["Location Problem"]
        Maze["Maze Problem"]
        Pathfinding["Pathfinding Problem"]
    end

    %% Algorithm Layer
    subgraph AlgorithmLayer["Algorithm Layer"]
        SearchAgent["Search Agent"]
        
        subgraph InformedSearch["Informed Search"]
            AStar["A* Search"]
            Greedy["Greedy Best-First"]
        end
        
        subgraph UninformedSearch["Uninformed Search"]
            BFS["Breadth-First Search"]
            DFS["Depth-First Search"]
            DLS["Depth-Limited Search"]
            UCS["Uniform Cost Search"]
            BiDir["Bidirectional Search"]
        end
    end

    %% Relationships
    AppComponent --> SearchProblemModule
    AppComponent --> SearchTreeModule
    SearchProblemModule --> SearchProblemInterface
    SearchTreeModule --> SearchAgent
    SearchProblemInterface --> EightPuzzle
    SearchProblemInterface --> Location
    SearchProblemInterface --> Maze
    SearchProblemInterface --> Pathfinding
    SearchAgent --> InformedSearch
    SearchAgent --> UninformedSearch

    %% Click Events
    click SearchProblemModule "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/frontend/src/app/search-problem/"
    click CoordSystem "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/frontend/src/app/search-problem/coordinate-system/"
    click MazeComp "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/frontend/src/app/search-problem/maze/"
    click SearchTreeModule "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/frontend/src/app/search-tree/"
    click TreeEntities "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/frontend/src/app/search-tree/entities/"
    click EightPuzzle "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/problems/eight-puzzle-problem/"
    click Location "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/problems/location-problem/"
    click Maze "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/problems/maze-problem/"
    click Pathfinding "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/problems/pathfinding-problem/"
    click AStar "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/tree-search/a-star-search/"
    click BiDir "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/tree-search/bidirectional-search/"
    click BFS "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/tree-search/breadth-first-search/"
    click DFS "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/tree-search/depth-first-search/"
    click DLS "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/tree-search/depth-limited-search/"
    click Greedy "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/tree-search/greedy-best-first-search/"
    click UCS "https://github.com/PhilippSchoen/tree-search-visualization/tree/main/src/tree-search/uniform-cost-search/"
    click SearchAgent "https://github.com/PhilippSchoen/tree-search-visualization/blob/main/src/tree-search/search-agent.ts"
    click SearchProblemInterface "https://github.com/PhilippSchoen/tree-search-visualization/blob/main/src/problems/search-problem.ts"

    %% Style Applications
    class AppComponent,SearchProblemModule,CoordSystem,MazeComp,SearchTreeModule,GraphViz,TreeEntities frontend
    class SearchProblemInterface,EightPuzzle,Location,Maze,Pathfinding problem
    class SearchAgent,AStar,Greedy,BFS,DFS,DLS,UCS,BiDir algorithm
    class SearchProblemInterface interface
```
