How to write the dual

109 Views Asked by At

So I do not have any problems writing the dual of the primal if I work with numerical examples, but however I am stuck on writing the dual of the shortest-path problem when it is written in a more "formal" way:

\begin{align*} &\text{minimize} & \sum_{(i,j) \in A} c_{ij} x_{ij}\\ &\text{subject to} & \sum_{k \in V^{+}(i)} x_{ik} - \sum_{k \in V^{-}(i)}x_{ki} &= \begin{cases} 1 &\text{for $i=s$}\\ 0 &\text{for $i \in V\setminus\{s,t\}$}\\ -1 &\text{for $i=t$ } \end{cases} \end{align*}

My book says this is the dual:

\begin{align*} &\text{maximize} & \pi_t - \pi_s\\ &\text{subject to} & \pi_j - \pi_i &\leq c_{ij} &&\text{for $(i,j)\in A$} \\ \end{align*}

However I do not understand this suggestion. So for every constraint in the primal we have one variable in the dual. Hence $\pi_s, \pi_i$ and $\pi_t$. This is at least what I am taught. There is only one variable in the primal, $x_{ij}$, if I am not mistanken. So there will only be one constraint in the primal, so I understand so far. I do however not understand how to obtain the constraint given in the dual. Why $\pi_j - \pi_i \leq c_{ij}$ ? More specifically, how do I obtain the left side of that inequality and why do we have a new varible $\pi_j$ as it is only three constraints in the primal, not four? I know there is a similiar question here on stackexchange, but I did not understand the answers properly. I would really appreciate some help! :)

1

There are 1 best solutions below

0
On

I rewrote your formulations for better clarity.

There are $|A|$ primal variables $x_{ij}$ and $|V|$ primal constraints (one per $i$). So there are $|A|$ dual constraints (one per $(i,j)$) and $|V|$ dual variables $\pi_i$.

Arthur Benjamin's S-O-B method is useful for obtaining the dual LP.