# inire: Auto-Routing for Photonic and RF Integrated Circuits
`inire` is a high-performance auto-router designed specifically for the physical constraints of photonic and RF integrated circuits. It utilizes a Hybrid State-Lattice A* search combined with "Negotiated Congestion" (PathFinder) to route multiple nets while maintaining strict geometric fidelity and clearance.
## Key Features
***Hybrid State-Lattice Search**: Routes using discrete 90° bends and parametric S-bends, ensuring manufacturing-stable paths.
***Negotiated Congestion**: Iteratively resolves multi-net bottlenecks by inflating costs in high-traffic regions.
***Analytic Correctness**: Every move is verified against an R-Tree spatial index of obstacles and other paths.
***1nm Precision**: All coordinates and ports are snapped to a 1nm manufacturing grid.
***Safety & Proximity**: Incorporates a "Danger Map" (pre-computed distance transform) to maintain optimal spacing and reduce crosstalk.
***Locked Paths**: Supports treating existing geometries as fixed obstacles for incremental routing sessions.
## Installation
`inire` requires Python 3.11+. You can install the dependencies using `uv` (recommended) or `pip`:
```bash
# Using uv
uv sync
# Using pip
pip install numpy scipy shapely rtree matplotlib
```
## Quick Start
```python
from inire.geometry.primitives import Port
from inire.geometry.collision import CollisionEngine
`inire` operates on a **State-Lattice** defined by $(x, y, \theta)$. From any state, the router expands via three primary "Move" types:
1.**Straights**: Variable-length segments.
2.**90° Bends**: Fixed-radius PDK cells.
3.**Parametric S-Bends**: Procedural arcs for bridging small lateral offsets ($O < 2R$).
For multi-net problems, the **PathFinder** loop handles rip-up and reroute logic, ensuring that paths find the globally optimal configuration without crossings.
`inire` is highly tunable. Every major component (Router, CostEvaluator, PathFinder) accepts explicit named arguments in its constructor to control expansion rules, cost weights, and convergence limits. See `DOCS.md` for a full parameter reference.