I would like to create a constraint with AMPL that checks whether I am able to reach from one node $v$ to all other nodes of a set but I don't really know how to formulate it (especially in AMPL (+CPLEX)).
(I am not interested in finding the shortest paths just a path per pair of nodes $(v,*)$ (Floyd-Warshall))
Basically the main goal of my optimisation is to split graphs into two subgraphs even so this extends the question itself (the objective function is untested and highly experimental): For a connected graph $G=(V,E_V)$ I'd like to find two connected subgraphs $SG1=(U,E_U)$ and $SG2=(W,E_W)$ $$ \begin{split} & \min |\text{card}(U)-\text{card}(W)|\cdot\text{card}\left(N^+_{E_V}(U)\cap N^+_{E_V}(W)\right)\\ & \exists v\in U: N^+_{E_U}(v)=U \text{ therefore the first subgraph is connected}\\ & \exists v\in W: N^+_{E_W}(v)=W \text{ the second subgraph is connected}\\ & U\cap W=\emptyset\\ & N^+_{E} \text{ is the set of nodes that is reachable for a given set of edges} \end{split} $$