You are on page 1of 3

Shortest path LP written using general min-cost flow formulation, with edge capacities

cT

A
s
p
q
r
t

objective

(s,p)
4

(p,s)
2

(s,q)
3

(q,s)
4

(p,t)
6

(s,p)
1
-1
0
0
0

(p,s)
-1
1
0
0
0

(s,q)
1
0
-1
0
0

(q,s)
-1
0
1
0
0

(p,t)
0
1
0
0
-1

n, with edge capacities being all 1.

(q,r)
2

(r,t)
1

(q,r)
0
0
1
-1
0

(r,t)
0
0
0
1
-1

x
(s,p)
(p,s)
(s,q)
(q,s)
(p,t)
(q,r)
(r,t)

0
0
0
0
0
0
0

u
1
1
1
1
1
1
1

Ax
0
0
0
0
0

NegD
1
0
0
0
-1