pie title Differences Covered (mod 13) "1" : 1 "2" : 1 "3" : 1 "6" : 1 "8" : 1 "9" : 1 "Other residues" : 6
graph LR A[Start with empty set] --> B[Add next candidate number] B --> C[Calculate new differences] C --> D{Are enough new differences covered?} D -->|Yes| E[Recurse to next level] D -->|No| F[Prune this branch] E --> G{Solution complete?} G -->|Yes| H[Return solution] G -->|No| B F --> I[Backtrack]
stateDiagram [*] --> Start Start --> AddNumber: Initial state AddNumber --> CheckCoverage: Add next candidate CheckCoverage --> Prune: Not enough new differences CheckCoverage --> Recurse: Good progress Prune --> Backtrack Recurse --> SolutionFound: Complete cover Recurse --> AddNumber: Continue building Backtrack --> AddNumber: Try next candidate SolutionFound --> [*]
graph LR Main[Main Thread]:::main -->|Divides Range| Pool[Thread Pool]:::pool Pool --> Worker1[Worker 1]:::worker1 Pool --> Worker2[Worker 2]:::worker2 Pool --> Worker3[...]:::worker3 Pool --> WorkerN[Worker N]:::workerN Worker1 --> Search1[Recursive Search]:::search Worker2 --> Search2[Recursive Search]:::search WorkerN --> SearchN[Recursive Search]:::search Search1 --> Results[Results]:::results Search2 --> Results SearchN --> Results classDef main fill:#673AB7,stroke:#5E35B1,color:white classDef pool fill:#3F51B5,stroke:#3949AB,color:white classDef worker1 fill:#FF5722,stroke:#E64A19,color:white classDef worker2 fill:#FF9800,stroke:#F57C00,color:black classDef worker3 fill:#FFC107,stroke:#FFA000,color:black classDef workerN fill:#FFEB3B,stroke:#FBC02D,color:black classDef search fill:#4CAF50,stroke:#388E3C,color:white classDef results fill:#607D8B,stroke:#455A64,color:white
graph LR A[Agent] -->|Action: Select number| B[Environment] B -->|Reward: Coverage score| A B -->|New State| A A -->|Update Policy| A
sequenceDiagram participant Agent participant Environment Agent->>Environment: Select action (add number) Environment->>Agent: Return reward and new state Agent->>Agent: Calculate policy gradient Agent->>Agent: Update network weights loop Next action Agent->>Environment: Select next action end
graph LR Input[Input LayerState Vector] -->|Weights W1| Hidden[Hidden LayerReLU Activation] Hidden -->|Weights W2| Output[Output LayerSoftmax] Output --> Action[Action Probabilities]
graph LR A[Shared Policy Network]:::neural --> B[Thread 1]:::thread1 A --> C[Thread 2]:::thread2 A --> D[Thread 3]:::thread3 B --> E[Episodes 1,4,7...]:::episode1 C --> F[Episodes 2,5,8...]:::episode2 D --> G[Episodes 3,6,9...]:::episode3 E & F & G --> H[Gradient Pool]:::gradient H --> A H --> I{Solution?}:::decision I -->|Yes| J[Terminate All]:::success I -->|No| B classDef neural fill:#89b4fa,stroke:#1e66f5,stroke-width:3px classDef thread1 fill:#f9e2af,stroke:#df8e1d classDef thread2 fill:#fab387,stroke:#e64553 classDef thread3 fill:#cba6f7,stroke:#8839ef classDef episode1 fill:#f9e2af,stroke:#df8e1d classDef episode2 fill:#fab387,stroke:#e64553 classDef episode3 fill:#cba6f7,stroke:#8839ef classDef gradient fill:#94e2d5,stroke:#179299,stroke-width:2px classDef decision fill:#f5c2e7,stroke:#ea76cb,diamond classDef success fill:#a6e3a1,stroke:#4a8f3e