Graph Construction (10 points) Suppose you are given a unweighted directed graph
G=(V,E)with
nvertices and
medges. You are also given a set of constants
a_(1)dots,a_(n)inN. Finally, you are given a starting node
sinVand an ending node
tinV. Describe an algorithm that finds the shortest walk length from
sto
t, such that there exist variables
x_(1),dots,x_(n)inNthat satisfy
W=a_(1)x_(1) cdots a_(n)x_(n), where
Wis the number of steps in the shortest walk. Give a rigorous proof for the correctness of your algorithm and its runtime which should be in
O(n m).