Closed
Description
The way the squash
is currently implemented is by either calling SimpleGraph{T}(g)
or SimpleDiGraph{T}(g)
for some integer type T
. This fails if g
is a subtype of AbstractGraph
for which these functions are not implemented. There are multiple ways to solve this:
- Restrict
squash
toSimpleGraph
andSimpleDiGraph
and leave the implementation of that function for other graph types open. - Ensure that the constructors
SimpleGraph{T}(g)
orSimpleDiGraph{T}(g)
work for for any kind ofg::AbstractGraph
. - Require that subtypes of any kind of graph type
SomeGraph <: AbstractGraph
implement a constructorSomeGraph{T}(g)
and adjustsquash
accordingly.
In my opinion, 1. is the way to go. 2. could lead to some information (such as metadata) being thrown away by squash
which is probably not what the user wants. 3. would make the interface more complicated and would make existing packages not correspond to the interface anymore.