# armandofln/local-graham architecture

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

- Interactive diagram: https://gitdiagram.com/armandofln/local-graham
- Repository: https://github.com/armandofln/local-graham

## Overview

This is a small C command-line search program for a Ramsey/Graham-theory coloring problem. Its workflow accepts a dimension and search-method options, constructs a random two-coloring of graph edges, searches for a coloring with no monochromatic target subgraphs, and reports a counterexample or the best score. Geometry and scoring are distinct internal stages. The excerpts show some calls but omit parts of `main` and other function bodies, so the graph leaves those relationships out rather than inferring them.

Main entry points: [`graham.c`](https://github.com/armandofln/local-graham/blob/master/graham.c) (Program entry), [`examples.txt`](https://github.com/armandofln/local-graham/blob/master/examples.txt) (Examples output)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Inputs and geometry"]
  node_program["Program entry<br/>[graham.c]"]
  node_arguments["Argument handling<br/>[graham.c]"]
  node_geometry["Coplanar subsets<br/>[graham.c]"]
  node_edge_map["Subset edge mapping<br/>[graham.c]"]
end

subgraph group_search["Coloring search"]
  node_random_coloring["Random edge coloring<br/>[graham.c]"]
  node_scoring["Monochromy scoring<br/>[graham.c]"]
  node_hill_climbing["Steepest search<br/>[graham.c]"]
  node_first_choice["First-choice search<br/>[graham.c]"]
end

subgraph group_output["Results"]
  node_reporting["Result reporting<br/>[graham.c]"]
  node_examples_file["Examples output<br/>[examples.txt]"]
end

node_user(("CLI user"))

node_user -->|"runs"| node_program
node_program -->|"parses options"| node_arguments
node_program -->|"initializes coloring"| node_random_coloring
node_program -->|"calls search"| node_hill_climbing
node_geometry -.->|"enumerates edges"| node_edge_map
node_hill_climbing -->|"scores candidates"| node_scoring
node_first_choice -->|"scores candidates"| node_scoring
node_hill_climbing -->|"reports counterexample"| node_reporting
node_first_choice -->|"reports counterexample"| node_reporting
node_reporting -->|"writes result"| node_examples_file

click node_program "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_arguments "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_geometry "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_edge_map "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_random_coloring "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_scoring "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_hill_climbing "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_first_choice "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_reporting "https://github.com/armandofln/local-graham/blob/master/graham.c"
click node_examples_file "https://github.com/armandofln/local-graham/blob/master/examples.txt"

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_program,node_arguments,node_geometry,node_edge_map,node_user toneBlue
class node_random_coloring,node_scoring,node_hill_climbing,node_first_choice toneAmber
class node_reporting,node_examples_file toneMint
```

## Components

### Inputs and geometry

- [Program entry](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`
- [Argument handling](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`
- [Coplanar subsets](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`
- [Subset edge mapping](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`

### Coloring search

- [Random edge coloring](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`
- [Monochromy scoring](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`
- [Steepest search](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`
- [First-choice search](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`

### Results

- [Result reporting](https://github.com/armandofln/local-graham/blob/master/graham.c): `graham.c`
- [Examples output](https://github.com/armandofln/local-graham/blob/master/examples.txt): `examples.txt`

### Other components

- **CLI user**

## Connections

- CLI user → Program entry: runs
- Program entry → Argument handling: parses options (evidence: `graham.c`)
- Program entry → Random edge coloring: initializes coloring (evidence: `graham.c`)
- Program entry → Steepest search: calls search (evidence: `graham.c`)
- Coplanar subsets → Subset edge mapping: enumerates edges (evidence: `graham.c`)
- Steepest search → Monochromy scoring: scores candidates (evidence: `graham.c`)
- First-choice search → Monochromy scoring: scores candidates (evidence: `graham.c`)
- Steepest search → Result reporting: reports counterexample (evidence: `graham.c`)
- First-choice search → Result reporting: reports counterexample (evidence: `graham.c`)
- Result reporting → Examples output: writes result (evidence: `graham.c`)
