# sun7ren/kka-fp architecture

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

- Interactive diagram: https://gitdiagram.com/sun7ren/kka-fp
- Repository: https://github.com/sun7ren/kka-fp

## Overview

KKA-FP is a command-line house-district search tool that ranks Surabaya districts using distance, house price, and crime rate. The user supplies a target location, criterion weights, and limits; each standalone script loads the district data, searches eligible districts using its own algorithm, and prints a recommendation and performance metrics. The README also describes a simulated-annealing variant, whose script additionally appends results to a log file. The graph reflects the shown script-level workflows; the three implementations are alternatives, not a shared pipeline.

Main entry points: [`sa.py`](https://github.com/sun7ren/kka-fp/blob/main/sa.py) (Simulated Annealing), [`Uninformed_UCS.py`](https://github.com/sun7ren/kka-fp/blob/main/Uninformed_UCS.py) (Uniform-Cost Search), [`aStar.py`](https://github.com/sun7ren/kka-fp/blob/main/aStar.py) (A* Search), [`District_Data.csv`](https://github.com/sun7ren/kka-fp/blob/main/District_Data.csv) (District Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["District Data"]
  node_district_data[("District Records<br/>[District_Data.csv]")]
end

subgraph group_search["Search Alternatives"]
  node_ucs["Uniform-Cost Search<br/>[Uninformed_UCS.py]"]
  node_astar["A* Search<br/>[aStar.py]"]
  node_annealing["Simulated Annealing<br/>[sa.py]"]
end

subgraph group_results["Results"]
  node_recommendation["Recommendation Output"]
  node_results_log["Results Log"]
end

node_user(("House Seeker"))

node_user -->|"provides criteria"| node_ucs
node_user -->|"provides criteria"| node_astar
node_user -->|"provides criteria"| node_annealing
node_ucs -->|"loads records"| node_district_data
node_astar -->|"loads records"| node_district_data
node_annealing -->|"loads records"| node_district_data
node_ucs -->|"prints ranking"| node_recommendation
node_astar -->|"prints ranking"| node_recommendation
node_annealing -->|"prints ranking"| node_recommendation
node_annealing -->|"appends result"| node_results_log

click node_district_data "https://github.com/sun7ren/kka-fp/blob/main/District_Data.csv"
click node_ucs "https://github.com/sun7ren/kka-fp/blob/main/Uninformed_UCS.py"
click node_astar "https://github.com/sun7ren/kka-fp/blob/main/aStar.py"
click node_annealing "https://github.com/sun7ren/kka-fp/blob/main/sa.py"

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_district_data toneBlue
class node_ucs,node_astar,node_annealing toneAmber
class node_recommendation,node_results_log toneMint
class node_user toneIndigo
```

## Components

### District Data

- [District Records](https://github.com/sun7ren/kka-fp/blob/main/District_Data.csv): `District_Data.csv`

### Search Alternatives

- [Uniform-Cost Search](https://github.com/sun7ren/kka-fp/blob/main/Uninformed_UCS.py): `Uninformed_UCS.py`
- [A* Search](https://github.com/sun7ren/kka-fp/blob/main/aStar.py): `aStar.py`
- [Simulated Annealing](https://github.com/sun7ren/kka-fp/blob/main/sa.py): `sa.py`

### Results

- **Recommendation Output**
- **Results Log**

### Other components

- **House Seeker**

## Connections

- House Seeker → Uniform-Cost Search: provides criteria (evidence: `Uninformed_UCS.py`)
- House Seeker → A* Search: provides criteria (evidence: `aStar.py`)
- House Seeker → Simulated Annealing: provides criteria (evidence: `sa.py`)
- Uniform-Cost Search → District Records: loads records (evidence: `Uninformed_UCS.py`)
- A* Search → District Records: loads records (evidence: `aStar.py`)
- Simulated Annealing → District Records: loads records (evidence: `sa.py`)
- Uniform-Cost Search → Recommendation Output: prints ranking (evidence: `Uninformed_UCS.py`)
- A* Search → Recommendation Output: prints ranking (evidence: `aStar.py`)
- Simulated Annealing → Recommendation Output: prints ranking (evidence: `sa.py`)
- Simulated Annealing → Results Log: appends result (evidence: `sa.py`)
