Hi,

I am trying to integrate a boost graph implementation of Tarjan's optimal branching algorithm with graph_toolThe code is in pure C++ and I want to wrap it using boost python.

The ultimate goal is I can pass in a `graph_tool.Graph` instance to the wrapped function directly.

For example:

```

```

from graph_tool.generation import complete_graph

from pyedmond import optimal_branchingÂ # suppose I made it already, pyedmond is the name of the module afterÂ wrapping

g = complete_graph(1000, directed=True)

optimal_branching(g) # it runs and give the correct result.

g = complete_graph(1000, directed=True)

optimal_branching(g) # it runs and give the correct result.

```

instead of using `graph_tool.Graph`, I created another graph type using boost graph (in C++), say the name is `MyGraph`.

Then I pass the edges and weights in `graph_tool.Graph` (in Python) to `MyGraph` (in C++) via boost python so that a new MyGraph is created.

Then I pass the edges and weights in `graph_tool.Graph` (in Python) to `MyGraph` (in C++) via boost python so that a new MyGraph is created.

Last I pass in the MyGraph instance to the optimalÂ branching function in C++.

I do this "graph copying" because `graph_tool.Graph` does not match the signature of the optimal branching function, which requires:

```

boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>

```

```

boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>

```

----------------

My question is:

Can I circumvent the graph copying procedure?

--

Best

Han