Relational consistency algorithms and their application in finding subgraph and graph isomorphisms