I have a mid-size two sided network, and am just trying to run a simple routing. $x_{i,j}^d$ takes a value of one if $d$ travel from $i$ to $j$. Each driver starts from origins $s_d$ and finishes at $e_d$. This is my simple routing:
$\sum_{j} x_{s_d,j}^d = 1 \qquad \forall d$
$\sum_{i} x_{i,e_d}^d = 1 \qquad \forall d$
$\sum_{i} x_{i,j}^d = \sum_{k} x_{j,k}^d \qquad \forall d , \forall j \ne {s_d,e_d}$
The issue I'm facing is that my network is two sided (i.e. if we have $(i,j)$ then we do have $(j,i)$. And this cause an issue of seeing all routes ended up just exiting and entering origins and exiting and entering destination. This way the model actually satisfies all the above constraints without even actually traveling from $s_d$ to $e_d$. What's the issue? And how can I fix it?
To eliminate such 2-cycles, you can impose additional constraints $$x_{ij}^d+x_{ji}^d\le 1.$$ To eliminate longer subtours, look up generalized subtour elimination constraints.