Add caching to clique embedding functions
Because the find_clique_embedding functions take a size as input, we could fairly easily add caching. Something like
emb = chimera.find_clique_embedding(7, 16, 16, 4, use_cache=True)
We would also need to handle the
emb = chimera.find_clique_embedding(['a', 'b', 'c'], 16, 16, 4, use_cache=True)
case.
Additional Context functools.lru_cache gets us most of the way there. We might want to also expose the cache size; 128 would cover all 64 clique embeddings for a fully yielded C16 but not the 192 for a P16 but if the user is dealing with different lattice sizes and/or working graphs they might want to store more.
Please note that the clique embedder is quite inefficient at the moment, and for large k, it's basically computing the entire cache every time. Also, I'm working on a total rewrite -- so I'd recommend holding off on this for now.
This was done as part of https://github.com/dwavesystems/dwave-system/pull/370