Structural pattern recognition