Graph Construction (10 points) Suppose you are given a unweighted directed graph
G=(V,E)
with
n
vertices and
m
edges. You are also given a set of constants
a_(1)dots,a_(n)inN
. Finally, you are given a starting node
sinV
and an ending node
tinV
. Describe an algorithm that finds the shortest walk length from
s
to
t
, such that there exist variables
x_(1),dots,x_(n)inN
that satisfy
W=a_(1)x_(1) cdots a_(n)x_(n)
, where
W
is 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)
.