Solution - TAMU Computer Science Faculty Pages

Transcription

Solution - TAMU Computer Science Faculty Pages
26.2-11
Define a flow network 𝐺𝑠,𝑑 for any two vertices 𝑠 and 𝑑 in 𝐺 by switching to the direct version of
graph 𝐺 with 𝑠 as source and 𝑑 as sink, and all edges’ capacities are set to 1 to have the number
of edges crossing a cut in 𝐺 equals to the capacity of cut in 𝐺𝑠,𝑑 . For each edge (𝑒, 𝑣) ∈ 𝐸, the
directed edge from 𝑒 to 𝑣 also need a directed edge from 𝑣 to 𝑒 when transform an edge from an
undirected graph. Suppose 𝑓𝑠,𝑑 is a maximum flow in 𝑁𝑠,𝑑 . For any 𝑠 ∈ 𝑉, the edge connectivity
π‘˜ = min {𝑓𝑠,𝑑 }.
π‘‘βˆˆπ‘‰βˆ’{𝑠}
26.3-3
By definition, an augmenting path is a simple path 𝑠 β†’ 𝑑 in the residual graph 𝐺′𝑓 . Since 𝐺 has
no edges between vertices in 𝐿 and no edges between vertices in 𝑅 , neither does the flow
network 𝐺′ and hence neither does 𝐺′𝑓 . Also, the only edges involving 𝑠 or 𝑑 connect 𝑠 to 𝐿 and
𝑅 to 𝑑. Note that although edges in 𝐺′ can go only from 𝐿 to 𝑅, edges in 𝐺′𝑓 can also go from 𝑅
to 𝐿. Thus any augmenting path must go 𝑠 β†’ 𝐿 β†’ 𝑅 β†’ β‹― β†’ 𝐿 β†’ 𝑅 β†’ 𝑑, crossing back and forth
between 𝐿 and 𝑅 at most as many times as it can do so without using a vertex twice. It contains 𝑠,
𝑑, and equal numbers of distinct vertices from 𝐿 and 𝑅: at most 2 + 2 × π‘šπ‘–π‘›(|𝐿|, |𝑅|) vertices in
all. The length of an augmenting path (i.e., its number of edges) is thus bounded above by
2 βˆ™ π‘šπ‘–π‘›(|𝐿|, |𝑅|) + 1.
26.1
1.
If each vertex has their own capacity, we can split each vertex 𝑣𝑖,𝑗 into two end points:
one is the source point (𝑠𝑖,𝑗 ) and the other is the terminal point (𝑑𝑖,𝑗 ). An edge with the
same capacity as the vertex is added between these two corresponding end points
(pointing from source to terminal). All incoming edges of any vertex 𝑣𝑖,𝑗 are connected to
its source point, and all outgoing edges of the vertex are connected to its terminal point.
Obviously, the valid flow in the original network is still feasible in the new network. The
transformation can be visualized as follows:
For time complexity, the newly created graph has 2𝑉 vertices and (|𝐸| + |𝑉|) edges. The
total time complexity is 𝑂(𝑉𝐸 2 ).
2.
Starting from transforming the undirected graph into a flow network. This can be done by
the following two steps:
First, replace each undirected edge (𝑒, 𝑣) ∈ 𝐸 with bidirectional edges. The capacity of
each directed edge is assigned weight 1 as shown in the figures below. Since the given
graph is a 𝑛 × π‘› grid, the time complexity for this stage is (𝑛2 ) .
Second, add a source vertex 𝑠 and an edge of weight 1 from 𝑠 to each starting point. Also,
add a sink vertex 𝑑 and an edge of weight 1 from each boundary vertex to 𝑑. Since there
are π‘š starting points and at most 4𝑛 boundary vertices, the time complexity is estimated
as 𝑂(𝑛). Finally, we can run Edmond-Karp algorithm to solve the escape problem. The
total time complexity will be 𝑂(𝑉𝐸 2 ) = 𝑂(𝑛2 × π‘›4 ) = 𝑂(𝑛6 ).