Consider the following problem:
Input: a directed graph $G = (V,E,\omega)$ where $\omega : E \longrightarrow \mathbb{Z}$, two vertices $v_1, v_2 \in V$, and a weight $k \in \mathbb{Z}$
Question: Does there exist a walk from $v_1$ to $v_2$ with weight exactly $k$?
The weight of a walk is simply the sum of all edges in the path. Note that the walk can contain cycles.
Is this problem decidable? Is there any algorithm to solve this problem, if I don't care about the running time? My problem is that since we can have edges weighted with either positive or negative integers, it is hard to determine when to stop or turn back when it gets too low or too high.
For example, given the graph $G$ where $V = \{ v_1,v_2 \}$ and $E = \{e_1:(v_1,v-1), e_2:(v_1,v_2)\}$ and $\omega(e_1)=-2$ and $\omega(e_2)=1$, the question could be is there a walk from $v_1$ to $v_2$ with weight $-99$. The algorithm should say yes, as there is a walk starting from $v_1$ and self looping 50 times over edge $e_1$ before taking edge $e_2$ and terminating.
I previously asked about the complexity of a similar problem here, but there I was focused on the complexity of the problem. Others have shown that this problem is NP-hard. Also, the previously question asked about a path, whereas here I am asking about a walk (a vertex might be visited multiple times); the version with paths is in NP and thus decidable, but here I am asking about walks rather than paths.
Notice that this problem is not trivial, largely because we are talking about walks rather than simple paths. There is no a priori upper bound on the length of a walk from $v_1$ to $v_2$, so just enumerating all possible walks might never terminate. Also, the graph could contain exponentially many cycles, and the walk might visit some of them any number of times. And, there is no obvious upper bound on the number of times that we traverse any given cycle. In particular, it is not obvious whether this problem is in NP or not. A straightforward reduction to integer linear programming (an integer variable for each edge, counting how many times the walk traverses that edge) runs into the difficulty that it is not clear how to ensure that you have a walk and not a flow.