# sitriof/bolivar-rutas architecture

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

- Interactive diagram: https://gitdiagram.com/sitriof/bolivar-rutas
- Repository: https://github.com/sitriof/bolivar-rutas

## Overview

Bolívar Rutas is a Flask web app for loading municipal road data, selecting endpoints and an algorithm, and viewing shortest-path or maximum-flow results on a map. The graph separates CSV ingestion, request orchestration, algorithm implementations, and visualization. The sampled app excerpt shows the main routing and dispatch; README and source index support the broader algorithm coverage. Some template and map wiring is only partially shown, so uncertain connections are omitted.

Main entry points: [`algorithms/__init__.py`](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/__init__.py) (Algorithm registry), [`app.py`](https://github.com/sitriof/bolivar-rutas/blob/main/app.py) (Flask routes), [`utils/graph_loader.py`](https://github.com/sitriof/bolivar-rutas/blob/main/utils/graph_loader.py) (Graph loader), [`templates/index.html`](https://github.com/sitriof/bolivar-rutas/blob/main/templates/index.html) (CSV upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflow"]
  node_upload["CSV upload<br/>[index.html]"]
  node_selection["Route selection<br/>[select.html]"]
  node_webapp["Flask routes<br/>[app.py]"]
  node_result["Results page<br/>[result.html]"]
  node_maprender["Map rendering<br/>[app.py]"]
  node_mapfile["Interactive map<br/>[map.html]"]
end

subgraph group_ingest["Road network data"]
  node_roadcsv["Road data<br/>[Rutas_Bol.csv]"]
  node_loader["Graph loader<br/>[graph_loader.py]"]
  node_distancegraph[("Distance graph<br/>[graph_loader.py]")]
end

subgraph group_routing["Shortest paths"]
  node_algorithmregistry["Algorithm registry<br/>[__init__.py]"]
  node_dijkstra["Dijkstra<br/>[dijkstra.py]"]
  node_astar["A-star<br/>[astar.py]"]
  node_bellmanford["Bellman-Ford<br/>[bellman_ford.py]"]
  node_floydwarshall["Floyd-Warshall<br/>[floyd_warshall.py]"]
  node_johnson["Johnson<br/>[johnson.py]"]
end

subgraph group_flow["Maximum flow"]
  node_capacitygraph[("Capacity graph<br/>[app.py]")]
  node_fordfulkerson["Ford-Fulkerson<br/>[ford_fulkerson.py]"]
  node_edmondskarp["Edmonds-Karp<br/>[edmonds_karp.py]"]
  node_dinic["Dinic<br/>[dinic.py]"]
  node_pushrelabel["Push-Relabel<br/>[push_relabel.py]"]
end

node_traveler(("Route user"))

node_traveler -->|"submits routes"| node_upload
node_upload -->|"uploads CSV"| node_webapp
node_webapp -->|"loads graph"| node_loader
node_roadcsv -.->|"supplies rows"| node_loader
node_loader -->|"builds graph"| node_distancegraph
node_webapp -->|"renders form"| node_selection
node_selection -->|"submits choices"| node_webapp
node_webapp -->|"dispatches algorithm"| node_algorithmregistry
node_algorithmregistry -->|"registers"| node_dijkstra
node_algorithmregistry -->|"registers"| node_astar
node_algorithmregistry -->|"registers"| node_bellmanford
node_algorithmregistry -->|"registers"| node_floydwarshall
node_algorithmregistry -->|"registers"| node_johnson
node_webapp -->|"provides graph"| node_distancegraph
node_webapp -->|"builds capacities"| node_capacitygraph
node_algorithmregistry -->|"registers"| node_fordfulkerson
node_algorithmregistry -->|"registers"| node_edmondskarp
node_algorithmregistry -->|"registers"| node_dinic
node_algorithmregistry -->|"registers"| node_pushrelabel
node_webapp -->|"creates map"| node_maprender
node_maprender -->|"saves HTML"| node_mapfile
node_webapp -->|"renders results"| node_result

click node_upload "https://github.com/sitriof/bolivar-rutas/blob/main/templates/index.html"
click node_selection "https://github.com/sitriof/bolivar-rutas/blob/main/templates/select.html"
click node_webapp "https://github.com/sitriof/bolivar-rutas/blob/main/app.py"
click node_result "https://github.com/sitriof/bolivar-rutas/blob/main/templates/result.html"
click node_roadcsv "https://github.com/sitriof/bolivar-rutas/blob/main/data/Rutas_Bol.csv"
click node_loader "https://github.com/sitriof/bolivar-rutas/blob/main/utils/graph_loader.py"
click node_distancegraph "https://github.com/sitriof/bolivar-rutas/blob/main/utils/graph_loader.py"
click node_algorithmregistry "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/__init__.py"
click node_dijkstra "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/dijkstra.py"
click node_astar "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/astar.py"
click node_bellmanford "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/bellman_ford.py"
click node_floydwarshall "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/floyd_warshall.py"
click node_johnson "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/johnson.py"
click node_capacitygraph "https://github.com/sitriof/bolivar-rutas/blob/main/app.py"
click node_fordfulkerson "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/flow/ford_fulkerson.py"
click node_edmondskarp "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/flow/edmonds_karp.py"
click node_dinic "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/flow/dinic.py"
click node_pushrelabel "https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/flow/push_relabel.py"
click node_maprender "https://github.com/sitriof/bolivar-rutas/blob/main/app.py"
click node_mapfile "https://github.com/sitriof/bolivar-rutas/blob/main/static/map.html"

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_upload,node_selection,node_webapp,node_result,node_maprender,node_mapfile,node_traveler toneBlue
class node_roadcsv,node_loader,node_distancegraph toneAmber
class node_algorithmregistry,node_dijkstra,node_astar,node_bellmanford,node_floydwarshall,node_johnson toneMint
class node_capacitygraph,node_fordfulkerson,node_edmondskarp,node_dinic,node_pushrelabel toneRose
```

## Components

### Web workflow

- [CSV upload](https://github.com/sitriof/bolivar-rutas/blob/main/templates/index.html): `templates/index.html`
- [Route selection](https://github.com/sitriof/bolivar-rutas/blob/main/templates/select.html): `templates/select.html`
- [Flask routes](https://github.com/sitriof/bolivar-rutas/blob/main/app.py): `app.py`
- [Results page](https://github.com/sitriof/bolivar-rutas/blob/main/templates/result.html): `templates/result.html`
- [Map rendering](https://github.com/sitriof/bolivar-rutas/blob/main/app.py): `app.py`
- [Interactive map](https://github.com/sitriof/bolivar-rutas/blob/main/static/map.html): `static/map.html`

### Road network data

- [Road data](https://github.com/sitriof/bolivar-rutas/blob/main/data/Rutas_Bol.csv): `data/Rutas_Bol.csv`
- [Graph loader](https://github.com/sitriof/bolivar-rutas/blob/main/utils/graph_loader.py): `utils/graph_loader.py`
- [Distance graph](https://github.com/sitriof/bolivar-rutas/blob/main/utils/graph_loader.py): `utils/graph_loader.py`

### Shortest paths

- [Algorithm registry](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/__init__.py): `algorithms/__init__.py`
- [Dijkstra](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/dijkstra.py): `algorithms/dijkstra.py`
- [A-star](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/astar.py): `algorithms/astar.py`
- [Bellman-Ford](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/bellman_ford.py): `algorithms/bellman_ford.py`
- [Floyd-Warshall](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/floyd_warshall.py): `algorithms/floyd_warshall.py`
- [Johnson](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/johnson.py): `algorithms/johnson.py`

### Maximum flow

- [Capacity graph](https://github.com/sitriof/bolivar-rutas/blob/main/app.py): `app.py`
- [Ford-Fulkerson](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/flow/ford_fulkerson.py): `algorithms/flow/ford_fulkerson.py`
- [Edmonds-Karp](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/flow/edmonds_karp.py): `algorithms/flow/edmonds_karp.py`
- [Dinic](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/flow/dinic.py): `algorithms/flow/dinic.py`
- [Push-Relabel](https://github.com/sitriof/bolivar-rutas/blob/main/algorithms/flow/push_relabel.py): `algorithms/flow/push_relabel.py`

### Other components

- **Route user**

## Connections

- Route user → CSV upload: submits routes (evidence: `README.md`)
- CSV upload → Flask routes: uploads CSV (evidence: `app.py`)
- Flask routes → Graph loader: loads graph (evidence: `app.py`)
- Road data → Graph loader: supplies rows (evidence: `README.md`)
- Graph loader → Distance graph: builds graph (evidence: `utils/graph_loader.py`)
- Flask routes → Route selection: renders form (evidence: `app.py`)
- Route selection → Flask routes: submits choices (evidence: `app.py`)
- Flask routes → Algorithm registry: dispatches algorithm (evidence: `app.py`)
- Algorithm registry → Dijkstra: registers (evidence: `algorithms/__init__.py`)
- Algorithm registry → A-star: registers (evidence: `algorithms/__init__.py`)
- Algorithm registry → Bellman-Ford: registers (evidence: `algorithms/__init__.py`)
- Algorithm registry → Floyd-Warshall: registers (evidence: `algorithms/__init__.py`)
- Algorithm registry → Johnson: registers (evidence: `algorithms/__init__.py`)
- Flask routes → Distance graph: provides graph (evidence: `app.py`)
- Flask routes → Capacity graph: builds capacities (evidence: `app.py`)
- Algorithm registry → Ford-Fulkerson: registers (evidence: `algorithms/__init__.py`)
- Algorithm registry → Edmonds-Karp: registers (evidence: `algorithms/__init__.py`)
- Algorithm registry → Dinic: registers (evidence: `algorithms/__init__.py`)
- Algorithm registry → Push-Relabel: registers (evidence: `algorithms/__init__.py`)
- Flask routes → Map rendering: creates map (evidence: `app.py`)
- Map rendering → Interactive map: saves HTML (evidence: `app.py`)
- Flask routes → Results page: renders results (evidence: `app.py`)
