Exercise Lover

June 22, 2007

Exercises 22.4-5

Filed under: 22.4 — yuhanlyu @ 1:15 pm

Since every edge can be deleted once, the time complexity is O(V+E). If the graph contains cycle, this algorithm does not work.

Exercises 22.4-4

Filed under: 22.4 — yuhanlyu @ 1:14 pm

Disprove. Let G=(V,E), V={1,2,3,4}, E={<1,3>,<3,2>,<2,1>,<2,4>,<4,3>}. Start with 2 or 4 have different bad edges.

Exercises 22.4-3

Filed under: 22.4 — yuhanlyu @ 1:10 pm

Suppose that G has fewer than |V| edges, otherwise G must contain cycle. And we can use the DFS to check whether G has back edge or not. If there is no back edge, then G contains no cycle.

Exercises 22.4-2

Filed under: 22.4 — yuhanlyu @ 1:07 pm

Start with s, all the nodes which are adjacent to s have path 1. For a node v, if there more than one incoming edges, then the path from s to v is the summation of all incoming edges’ incident vertices’ paths. Finally, we can find the paths from s to t.

Exercises 22.4-1

Filed under: 22.4 — yuhanlyu @ 1:02 pm

Blog at WordPress.com.