automaton
.push_weights
Push the weights towards in the initial states.
This algorithm uses a generalized shortest distance defined as:
Where is the set of paths from q to a final state, and is the weight of the path , i.e. the product of the weights of its transitions.
push_weights
is defined for any acyclic automaton, since is finite for any state .
For cyclic automata, might be infinite, in which case push_weights
is guaranteed to terminate and to be correct only if the sum converges in a finite number of steps. Examples of automata verifying this property include
automata with weights in
automata with positive cycles and weights in
Preconditions:
The weightset is zero-sum-free and weakly divisible
The shortest distance to the final state is defined for every state of the automaton
Postconditions:
The Result is equivalent to the input automaton
Examples
In a Tropical Semiring
The following example is taken from mohri.2009.hwa, Figure 12.
Note that weight pushing improves the "minimizability" of weighted automata:
In
Again, the following example is taken from mohri.2009.hwa, Figure 12 (subfigure 12.d lacks two transitions), but computed in rather than to render more readable results.