ciaranm / glasgow-subgraph-solver

A solver for subgraph isomorphism problems, based upon a series of papers by subsets of McCreesh, Prosser, and Trimble.
MIT License
62 stars 23 forks source link

Add missing <map> include to input_graph.cc #13

Closed boothby closed 1 year ago

boothby commented 1 year ago

Hello,

At D-Wave, we've been using the Glasgow solver internally for a few years to solve subgraph isomorphism problems. After getting a few requests, I've decided to wrap this library into minorminer so that our users can find highly-performant embeddings into our hardware quickly. I'm quite impressed by the quality and performance of this package, so kudos and thanks very much!

I encountered one minor issue in wrapping your code though. It seems that input_graph.cc is missing an include for the STL map. This doesn't appear to be an issue to your build, presumably because map is getting included elsewhere. But I'm short-cutting your executable and using sip_decomposer as a library that gets built into a Python extension. I could hack around this, but I believe the appropriate place to fix the problem is here.

Thanks and kind regards,

Kelly

ciaranm commented 1 year ago

Thanks very much. In general, I'm happy to accept patches that make it easier to use the solver as a library. If there's a use for it, I could also spend some time tidying up the headers, switching to CMake, etc: this has been on my todo list for a long time, but it's never quite made it to the top...

boothby commented 1 year ago

Well, the good news for me is that I'm able to entirely bypass your build system by using Cython. Tidy headers are nice, but I tend to prefer header-only libraries (which would be a big ask, I think, and might not be compatible with your goals). I'd previously wrapped & refactored pathLAD for use as a library, and that was an adventure. By comparison, wrapping your code was an absolute breeze -- I only touched the one line!

The biggest hurdle for us was the use of boost, which I wouldn't ask you to remove. The horrid solution we settled on is to re-implement just enough of the boost headers to eke by, and in the end, there wasn't much work to do there.