# tewatia5355/topsis_tewatia architecture

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

- Interactive diagram: https://gitdiagram.com/tewatia5355/topsis_tewatia
- Repository: https://github.com/tewatia5355/topsis_tewatia

## Overview

Topsis_Tewatia is a small command-line TOPSIS package. The user supplies a CSV decision matrix, criterion weights, and benefit/cost impacts; the command validates inputs, normalizes the criteria, selects positive and negative ideal values, scores and ranks alternatives, then writes an output CSV. The README documents the input and output formats; source excerpts show the calculation stages and file handling. This is a single-file runtime, so the graph focuses on its actual workflow rather than delivery machinery.

Main entry points: [`Topsis_Tewatia/topsis.py`](https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py) (CLI validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command workflow"]
  node_cli["CLI validation<br/>[topsis.py]"]
  node_input["Decision CSV"]
  node_matrix["Input preparation<br/>[topsis.py]"]
  node_output["Ranked CSV"]
end

subgraph group_calculation["TOPSIS calculation"]
  node_normalize["Normalize criteria<br/>[topsis.py]"]
  node_ideals["Ideal solutions<br/>[topsis.py]"]
  node_score["Score and rank<br/>[topsis.py]"]
end

node_user(("User"))

node_user -->|"provides arguments"| node_cli
node_user -->|"provides matrix"| node_input
node_cli -->|"reads CSV"| node_input
node_cli -->|"validates and prepares"| node_matrix
node_matrix -->|"passes matrix and weights"| node_normalize
node_normalize -->|"passes normalized values"| node_ideals
node_ideals -->|"passes ideal values"| node_score
node_score -->|"writes scores and ranks"| node_output
node_user -->|"receives result"| node_output

click node_cli "https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py"
click node_matrix "https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py"
click node_normalize "https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py"
click node_ideals "https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py"
click node_score "https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.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_cli,node_input,node_matrix,node_output,node_user toneBlue
class node_normalize,node_ideals,node_score toneAmber
```

## Components

### Command workflow

- [CLI validation](https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py): `Topsis_Tewatia/topsis.py`
- **Decision CSV**
- [Input preparation](https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py): `Topsis_Tewatia/topsis.py`
- **Ranked CSV**

### TOPSIS calculation

- [Normalize criteria](https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py): `Topsis_Tewatia/topsis.py`
- [Ideal solutions](https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py): `Topsis_Tewatia/topsis.py`
- [Score and rank](https://github.com/tewatia5355/topsis_tewatia/blob/master/Topsis_Tewatia/topsis.py): `Topsis_Tewatia/topsis.py`

### Other components

- **User**

## Connections

- User → CLI validation: provides arguments (evidence: `README.md`)
- User → Decision CSV: provides matrix (evidence: `README.md`)
- CLI validation → Decision CSV: reads CSV (evidence: `Topsis_Tewatia/topsis.py`)
- CLI validation → Input preparation: validates and prepares (evidence: `Topsis_Tewatia/topsis.py`)
- Input preparation → Normalize criteria: passes matrix and weights (evidence: `Topsis_Tewatia/topsis.py`)
- Normalize criteria → Ideal solutions: passes normalized values (evidence: `Topsis_Tewatia/topsis.py`)
- Ideal solutions → Score and rank: passes ideal values (evidence: `Topsis_Tewatia/topsis.py`)
- Score and rank → Ranked CSV: writes scores and ranks (evidence: `Topsis_Tewatia/topsis.py`)
- User → Ranked CSV: receives result (evidence: `README.md`)
