Longest common substring many strings to one
Let's assume you have already built suffix tree for string $S$. Then for any string $T$ you can find $\mathtt{LCS}(S, T)$ in $\mathcal{O}(|T|)$ time, $\mathcal{O}(1)$ space, and read-only access to the suffix tree.

Here's pseudocode that finds $M$ - location in the suffix tree (edge plus position on that edge) that corresponds to $\mathtt{LCS}(S, T)$:

M := C := ST.root

for i := 1..|T| do
  while C.canNotExtendWith(T[i]) do
    C := C.contract()

  C := C.extendWith(T[i])

  if C.length &gt; M.length then
    M := C


Here:


ST.root is the suffix tree root
C.canNotExtendWith(x) returns true if you can't follow given letter $x$ from location $C$
If $C$ is a location of string $U$ in the tree, then C.extendWith(x) returns location of string $Ux$
If $C$ is a location of string $xU$, then C.contract() returns location of $U$ (i.e. follows the suffix link)
If $C$ is a location of string $U$, then C.length is $|U|$


Both correctness and $\mathcal{O}(|T|)$ time complexity follow from the Ukkonen's algorithm.

Hand-wavy explanation of the algorithm correctness:


If you can't extend the substring with single letter, there's no point in trying to extend it further
If you've already found a good candidate substring, there's no point in contracting it