I'd guess this is well studied and I just don't have the keywords.
I have $N$ non-intersecting lines crossing from the left side of a rectangle to the right side. Inside the rectangle, there are bridges that allow curves under and over. I describe a bridge with a four-sided section of the rectangle with two alternate surfaces, one smoothly connected to the main surface on the "left" and "right" of the bridge-section and one smoothly connected on the "top" and "bottom". A true torus bridge would be triply-valued (where the bridge part has an underside), but this is unnecessary for my purposes; cut that disk out of the bridge.
I'm given the position & angle of curves at the sides of the rectangle, the position and shape of the bridges, and which bridges each curve interacts with (including order, whether it's over or under the bridge, all qualitative/topological knowledge about the curve). How can I draw the curves so that they are repelling, or maximally spaced in some way? Bonus if it's sub-second computationally contractible.
Curves connecting over & under bridge
With the problem stated, here are some things I've been thinking about.
The bridges feel like a branch cut, something like $\sqrt{(z-1-i)(z-1+i)(z+1+i)(z+1-i)}$. This would be double-valued everywhere in the complex plane, but if we block off the curves from leaving each of the sheafs except from the appropriate vertical or horizontal sides, it seems like a nice description of the bridges. Which then makes me think of analytic continuation: could the curves be thought of as $\theta=0$ equipotentials of an analytically continued complex function? Alternatively, the $\theta=0$ equipotentials of Laplace over a periodic function, $\triangle\theta = 0$, $\theta$ periodic? If so, I have trouble with appropriate boundary conditions.
I could represent this like an electric potential problem, with charged lines under tension. It's my first thought, coming from physics. Feels like it'd need to be over-engineered to work and computationally difficult, though.
Go Lagrangian? Minimize $\mathcal{J} = \sum_{i<j}\mathcal{D}_{ij} - \sum_i\mathcal{K}_i$, with distance action $\mathcal{D}_{ij} = \int\mathrm{d}s_i\mathrm{d}s_j \left|\underline{f}_j-\underline{f}_i\right|^2$ and curvature action $\mathcal{K}_i=\int\mathrm{d}s_i \left|\ddot{\underline{f}}_i\right|^2$, where $s$ arclength parametrization. I've never done Lagrangian problems with multifunctions though.