1
$\begingroup$

Sorry for my English.

Here is the question:

Graph (V,E).

Definition: Legal's up-path in a graph from s to t is existent if and only if for every Vi, Vi+1 (for each i) fulfill w(Vi)<=w(Vi+1), when w(v) is a weight of the vertex.

We know that there is an algorithm like BFS that solve the problem of finding the shorter path in a Graph. We need to find, by reduction, an algorithm that solve the problem of legal's up-path.

I try to split each vertex, but it didn’t work (for example: for Vi=4, I tried to create 4 Edge, and then activate the BFS, but it didn’t work.

Thank u.

1 Answers 1

1

Assuming the BFS is for directed graphs, and you start with an undirected graph.

Hint: Try to pick a direction (and in some cases two) for each edge in the undirected graph so that the resulting graph is directed, and on which you can activate BFS.