Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Disallow construction of MetaGraph from directed graph? #118

Open
lassepe opened this issue Apr 16, 2021 · 3 comments
Open

Disallow construction of MetaGraph from directed graph? #118

lassepe opened this issue Apr 16, 2021 · 3 comments

Comments

@lassepe
Copy link

lassepe commented Apr 16, 2021

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?

@KristofferC
Copy link

Also got bitten by this.

@sbromberger
Copy link
Owner

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.

@KristofferC
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants