Exercise Lover

June 22, 2007

Problem 22-4

Filed under: Problem 22 — yuhanlyu @ 2:53 pm
  1. Transpose G into G’
  2. DFS in G’ from minimum number.

If u is reachable from v in G’, then v is reachable from u in G. Since we start the DFS with minimum number, we can find the minimum node which is reachable from u.

Problem 22-3

Filed under: Problem 22 — yuhanlyu @ 2:39 pm

It is a classical problem in graph theory. It is called Fleury’s algorithm. See reference.

Problem 22-2

Filed under: Problem 22 — yuhanlyu @ 2:37 pm

This is the classical problem in graph theory. See reference.

Problem 22-1

Filed under: Problem 22 — yuhanlyu @ 2:31 pm

Exercises 22.5-7

Filed under: 22.5 — yuhanlyu @ 1:54 pm
  1. Construct component graph.
  2. Topological sort
  3. Check whether it has a linear chain, if yes then return “Yes”.

The running time is O(|V|+|E|).
If u and v are in the same component, then there is a path from u to v. If u and v are in different component, since the component graph is a linear chain. There is one path from u to v or v to u.

Exercises 22.5-6

Filed under: 22.5 — yuhanlyu @ 1:50 pm

We can reduce the subgraph in one component to a cycle. Then this graph has the same component graph and has fewest edges.

Exercises 22.5-5

Filed under: 22.5 — yuhanlyu @ 1:47 pm

In the SCC’s algorithm, we can compute the component’s numbering. Then we can find all edges which endpoints are in different components. These edges are the edges in the component graph. But the graph is not simple graph, we must transform it into simple graph.

Exercises 22.5-4

Filed under: 22.5 — yuhanlyu @ 1:38 pm

G’s transpose’s component graph, is G’s component graph’s transpose. Hence they are equivalent.

Exercises 22.5-3

Filed under: 22.5 — yuhanlyu @ 1:28 pm

Incorrect. Let G=(V,E), V={0,1,2}, E={<0,1>,<0,2>,<1,0>}. If we start DFS with node 0, then the result is incorrect.

Exercises 22.5-2

Filed under: 22.5 — yuhanlyu @ 1:20 pm
Older Posts »

Blog at WordPress.com.