I know KMP (Knuth–Morris–Pratt) is used for one dimensional search. Can it be applied on 2 dimensional array of data? Or is there a more advanced one?
Maybe you can find something in this question. You should be able to use KMP with some adaption if you flatten the matrices you are looking for.