The naive solution to this problem would be to find the highest-weighted path in the intersection Unfortunately, the intersection of WFSAs takes the Cartesian product of their state sets.
materializing this intersection would have taken time exponential in K. To put this another way, inference is NP-hard even on a "trivial" factor graph: a single variable X 1 attached to K factors.