Kernel: Python 3
automaton.lightest_automaton(num=1, algo="auto")
Return an automaton containing only the transitions and states from the lightest path in automaton.
Arguments:
numthe number of paths in the resulting automaton (there might be fewer).algothe algorithm name.
The algorithm can be:
"auto": uses"dijkstra"implementation if the weightset cannot have lightening weights (for example ), "bellman-ford" otherwise."a-star""bellman-ford""dijkstra""yen": the only algorithm that can be used when trying to retrieve multiple paths, the algorithm does not count loops as possible paths.
Preconditions:
"dijkstra":automatonmust be tropical.
See also:
Examples
In [1]:
In [2]:
Out[2]:
In [3]:
Out[3]:
In [4]:
Out[4]: