A graph matching method and a graph matching distance based on subgraph assignments