# ramnindra/bridge_torch_problem architecture

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

- Interactive diagram: https://gitdiagram.com/ramnindra/bridge_torch_problem
- Repository: https://github.com/ramnindra/bridge_torch_problem

## Overview

This is a small C++ command-line solver for bridge-and-torch crossing times. The documented workflow is to provide a YAML configuration, run the program, and receive per-bridge minimum crossing times and totals. The implementation reads each bridge’s walk-time array and applies a bitmask dynamic program that considers pair crossings and torch returns. The README also describes a broader hikers-and-bridge scenario, but the sampled implementation accepts walk-time arrays; that richer scenario is not represented here.

Main entry points: [`src/torchbridge.cpp`](https://github.com/ramnindra/bridge_torch_problem/blob/master/src/torchbridge.cpp) (Test Runner), [`test.yaml`](https://github.com/ramnindra/bridge_torch_problem/blob/master/test.yaml) (YAML Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_config["YAML Config<br/>[test.yaml]"]
node_runner["Test Runner<br/>[torchbridge.cpp]"]
node_yaml["YAML Parser"]
node_solver["Crossing Solver<br/>[torchbridge.cpp]"]
node_console["Console Output"]

node_user -->|"runs"| node_runner
node_config -->|"provides input"| node_runner
node_runner -->|"loads documents"| node_yaml
node_runner -->|"solves crossings"| node_solver
node_solver -->|"recurses"| node_solver
node_runner -->|"prints totals"| node_console

click node_config "https://github.com/ramnindra/bridge_torch_problem/blob/master/test.yaml"
click node_runner "https://github.com/ramnindra/bridge_torch_problem/blob/master/src/torchbridge.cpp"
click node_solver "https://github.com/ramnindra/bridge_torch_problem/blob/master/src/torchbridge.cpp"

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_user toneBlue
class node_config,node_runner,node_solver toneTeal
class node_yaml,node_console toneIndigo
```

## Components

### Other components

- **User**
- [YAML Config](https://github.com/ramnindra/bridge_torch_problem/blob/master/test.yaml): `test.yaml`
- [Test Runner](https://github.com/ramnindra/bridge_torch_problem/blob/master/src/torchbridge.cpp): `src/torchbridge.cpp`
- **YAML Parser**
- [Crossing Solver](https://github.com/ramnindra/bridge_torch_problem/blob/master/src/torchbridge.cpp): `src/torchbridge.cpp`
- **Console Output**

## Connections

- User → Test Runner: runs (evidence: `README.md`)
- YAML Config → Test Runner: provides input (evidence: `src/torchbridge.cpp`)
- Test Runner → YAML Parser: loads documents (evidence: `src/torchbridge.cpp`)
- Test Runner → Crossing Solver: solves crossings (evidence: `src/torchbridge.cpp`)
- Crossing Solver → Crossing Solver: recurses (evidence: `src/torchbridge.cpp`)
- Test Runner → Console Output: prints totals (evidence: `src/torchbridge.cpp`)
