Graph-tool doesn't support mixed graphs?

Hello!

I’m looking for a graph library suitable for my project. I like graph-tool, but I need a library which supports mixed graphs. Looking through the documentation, it looks like graph-tool only supports directed and undirected multigraphs.

Is there any reason that mixed graphs aren’t supported? It looks like many other graph libraries don’t support mixed graphs either, so I guess there must be some reason…

Thanks,
Brigham

In what way would a “mixed graph” be different from a directed graph with some edges being reciprocal?

In the case of the route inspection graph touring algorithm, which visits all edges in the shortest distance possible, there is an important difference between an undirected edge and two reciprocal directed edges.

The algorithm would want to visit what is in reality just one edge more than once as it’s represented with two edges.

Seems like a narrow application. In any case, there’s no real need for a different data structure: this algorithm can be implemented on a directed graph, and if needed a reciprocal edge can be marked as “undirected”, using a property map.

Ok, I feel confident that I can implement it this way. You recommend that I construct the graph such that, as far as graph-tool is concerned, it’s a directed graph with no reciprocal edges and I use a property map to define which edges are undirected?

Although, if graph-tool doesn’t truly understand the underlying data, then don’t I lose a lot of it’s functionality? The entire library would effectively serve as a graph data structure, nothing more.

Thanks for the help!

Ok, I feel confident that I can implement it this way. You recommend that I construct the graph such that, as far as graph-tool is concerned, it’s a directed graph with no reciprocal edges and I use a property map to define which edges are undirected?

Yes.

Although, if graph-tool doesn’t truly understand the underlying data, then don’t I lose a lot of it’s functionality? The entire library would effectively serve as a graph data structure, nothing more.

What functionally do you have in mind? You would still be able to save/load the graph, draw the graph, compute connected components, spectral properties, find community structure, compute the flow, etc.