Boost.Python interface to Boost Graph Library (BGL)
I would like to use the Boost Graph Library (BGL), but I'm not much of a C++ programmer. I'd feel much more comfortable working in Python. Can I download the Boost Graph Library wrapped in Boost.Python? I'd rather not wrap myself if it already exists. Thanks. - BP __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
BP wrote:
I would like to use the Boost Graph Library (BGL), but I'm not much of a C++ programmer. I'd feel much more comfortable working in Python.
Can I download the Boost Graph Library wrapped in Boost.Python? I'd rather not wrap myself if it already exists.
Thanks.
Hello, I'm not aware of such wrapping. Also note that BGL is almost completely template code. This means that you can wrap only specific type of graph. Besides, most operations on graphs are implemented as free functions. So, to wrap BGL you'd need: 1. Define your own concrete (non-template) graph class which will define appropriate member functions. 2. Wrap that class with Boost.Python. This should not be too hard. For example, with the attached C++ code I can achieve:
import graph g = graph.Graph() g.add_vertex() 0 g.add_vertex() 1 print g digraph G { 0; 1; }
OTOH, I really don't have the time to make full-blown wrapping myself... - Volodya [Non-text portions of this message have been removed]
Vladimir Prus
1. Define your own concrete (non-template) graph class which will define appropriate member functions. 2. Wrap that class with Boost.Python.
One good way to make that flexible would be to use boost::python::object for all the interesting bits (vertex/edge properties, etc.) -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (3)
-
BP
-
David Abrahams
-
Vladimir Prus