# gulzat-dev/shortestpath architecture

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

- Interactive diagram: https://gitdiagram.com/gulzat-dev/shortestpath
- Repository: https://github.com/gulzat-dev/shortestpath

## Overview

ShortestPath is a command-line tool that reads a weighted directed graph and route queries from conf.txt, then prints route distances, bounded trip counts, and shortest-path results. Main parses the input, constructs the graph, and dispatches each query to the corresponding Methods operation. Graph and Node provide the in-memory graph model; Methods implements the query algorithms. The source excerpts show these runtime calls; the README documents the input format and supported query types.

Main entry points: [`src/kz/Main.java`](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Main.java) (Command runner), [`src/kz/Graph.java`](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Graph.java) (Graph registry), [`src/kz/Node.java`](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Node.java) (Weighted node), [`src/kz/Methods.java`](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Methods.java) (Route distance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Input and runtime"]
  node_input["Graph and queries<br/>[conf.txt]"]
  node_main["Command runner<br/>[Main.java]"]
end

subgraph group_model["Graph model"]
  node_graph["Graph registry<br/>[Graph.java]"]
  node_node["Weighted node<br/>[Node.java]"]
end

subgraph group_queries["Route queries"]
  node_distance["Route distance<br/>[Methods.java]"]
  node_trips["Bounded trip count<br/>[Methods.java]"]
  node_shortest["Shortest routes<br/>[Methods.java]"]
end

node_user(("User"))

node_user -->|"provides input"| node_input
node_main -->|"reads"| node_input
node_main -->|"builds graph"| node_graph
node_graph -->|"stores nodes"| node_node
node_main -->|"dispatches distance"| node_distance
node_main -->|"dispatches trips"| node_trips
node_main -->|"dispatches shortest path"| node_shortest
node_distance -->|"looks up nodes"| node_graph
node_distance -->|"reads edges"| node_node
node_trips -->|"traverses edges"| node_node
node_shortest -->|"updates distances"| node_graph
node_shortest -->|"relaxes edges"| node_node
node_main -->|"prints results"| node_user

click node_input "https://github.com/gulzat-dev/shortestpath/blob/master/conf.txt"
click node_main "https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Main.java"
click node_graph "https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Graph.java"
click node_node "https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Node.java"
click node_distance "https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Methods.java"
click node_trips "https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Methods.java"
click node_shortest "https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Methods.java"

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_input,node_main,node_user toneBlue
class node_graph,node_node toneAmber
class node_distance,node_trips,node_shortest toneMint
```

## Components

### Input and runtime

- [Graph and queries](https://github.com/gulzat-dev/shortestpath/blob/master/conf.txt): `conf.txt`
- [Command runner](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Main.java): `src/kz/Main.java`

### Graph model

- [Graph registry](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Graph.java): `src/kz/Graph.java`
- [Weighted node](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Node.java): `src/kz/Node.java`

### Route queries

- [Route distance](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Methods.java): `src/kz/Methods.java`
- [Bounded trip count](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Methods.java): `src/kz/Methods.java`
- [Shortest routes](https://github.com/gulzat-dev/shortestpath/blob/master/src/kz/Methods.java): `src/kz/Methods.java`

### Other components

- **User**

## Connections

- User → Graph and queries: provides input (evidence: `README.md`)
- Command runner → Graph and queries: reads (evidence: `src/kz/Main.java`)
- Command runner → Graph registry: builds graph (evidence: `src/kz/Main.java`)
- Graph registry → Weighted node: stores nodes (evidence: `src/kz/Graph.java`)
- Command runner → Route distance: dispatches distance (evidence: `src/kz/Main.java`)
- Command runner → Bounded trip count: dispatches trips (evidence: `src/kz/Main.java`)
- Command runner → Shortest routes: dispatches shortest path (evidence: `src/kz/Main.java`)
- Route distance → Graph registry: looks up nodes (evidence: `src/kz/Methods.java`)
- Route distance → Weighted node: reads edges (evidence: `src/kz/Methods.java`)
- Bounded trip count → Weighted node: traverses edges (evidence: `src/kz/Methods.java`)
- Shortest routes → Graph registry: updates distances (evidence: `src/kz/Methods.java`)
- Shortest routes → Weighted node: relaxes edges (evidence: `src/kz/Methods.java`)
- Command runner → User: prints results (evidence: `src/kz/Main.java`)
