Skip to main content
Figure 8 | Algorithms for Molecular Biology

Figure 8

From: Unrooted unordered homeomorphic subtree alignment of RNA trees

Figure 8

The reduction from MCM to Min-Cost Max-Flow . (a) The graph G constructed in the case where |X|=3 and |Y X | = 5. All edge capacities are 1, except for the edge (ϕ,t) whose capacity is c(ϕ,t) = |X| = 3. Edges of the form (x i ,y j ) have the costs w e (x i ,y j ) = w(x i ,y j ) - w(x i ) - w(y j ), and all other edges have zero costs. (b) The residual graph Gf after finding a minimum cost maximum flow f in the network. Edges over which there is a flow (depicted as thickened edges) reverse their direction (the edge (ϕ,t) is not saturated, and therefore both (ϕ,t) and (t,ϕ) belong to the residual graph). In this example, the flow implies the minimum cost matching M f  = {(x 1 ,y 1 ),(x 3 ,y 4 )}, where the elements x 2 ,y 2 ,y 3 , and y 5  are unmatched. (c) The graph Ĝ f obtained from Gf. All nodes in the set Y x  are removed, and length-2 paths of the form u → y → v are replaced with direct edges (u,v) (these are edges in the set Ê 2 f , depicted with dashed lines in the figure). The cost of an edge (u,v) is the minimum among the costs of the corresponding length-2 paths from u to v through a node in Y x . Finding minimum cost paths from s to all nodes in Ĝ f can be done in O(n2) time, where in additional O(n2) operations it is possible to obtain minimum cost paths from s to all nodes in Gf. (d) A minimum cost path from y 2  to x 1  in Gf. The path, depicted in dashed and dotted red, is P = y 2  → t → ϕ → x2 → y1 → x1. The corresponding return path P′ =  t → ϕ → x 2  →  y 1  →  x 1  →  s from t to s is obtained by removing from P the first edge y 2  →  tv(in dotted red), and adding at the end the edge x 1  →  s (in dotted green). The flow f′vobtained by returning one flow unit from t to s  along P′ is an optimal flow in the network N x 1 , y 2 , corresponding to the sub-instance (X ∖ {x 1 },Y ∖ {y 2 },w) (see proof of Lemma 10). The corresponding matching for this flow is M f ′ ={( x 2 , y 1 ),( x 3 , y 4 )}, which is an optimal matching for (X ∖ {x 1 },Y ∖ {y 2 },w).

Back to article page