MetaGraphs.jl icon indicating copy to clipboard operation
MetaGraphs.jl copied to clipboard

Disallow construction of `MetaGraph` from directed graph?

Open lassepe opened this issue 4 years ago • 3 comments

Similar to #59 I was just bitten by the fact that you could construct a MetaGraph from a LightGraphs.SimpleDiGraph, dropping the directedness. I was wondering whether this kind of implicit conversion to an undirected graph is ever desirable. I feel like it may be preferable to require explicit conversion via convert instead. Or, perhaps, issue a warning upon construction of an undirected graph from a directed one?

lassepe avatar Apr 16 '21 15:04 lassepe

Also got bitten by this.

KristofferC avatar Aug 13 '21 09:08 KristofferC

We allow construction of (undirected) SimpleGraphs from SimpleDiGraphs, though I can see how this might be confusing. I'm open to dropping the constructor, but this means you'd have to go SimpleDiGraph -> SimpleGraph -> MetaGraph if you wanted an undirected MetaGraph from a SimpleDiGraph.

sbromberger avatar Aug 13 '21 10:08 sbromberger

I guess that is breaking so perhaps it is not worth doing. Disregarding that, I do think it is ok to have to "double jump" like that though.

KristofferC avatar Aug 13 '21 13:08 KristofferC