Skip to content

transitiveclosure! silently unimplemented #89

Closed
@drbergman

Description

@drbergman

transitiveclosure!(::MetaGraph) will return without error (at least when the underlying graph is a SimpleDiGraph{Int64}) but the transitive closure is not actually computed.

MWE

using Graphs, MetaGraphsNext, GraphPlot
G = MetaGraph(SimpleDiGraph();
    label_type=Symbol,
    vertex_data_type=Nothing,
    edge_data_type=Nothing)

G[:a] = nothing
G[:b] = nothing
G[:c] = nothing

G[:a, :b] = nothing
G[:b, :c] = nothing

transitiveclosure!(G)
gplot(G) # shows original graph of G, i.e. `a -> b -> c`

# can get expected behavior this way:
transitiveclosure!(G.graph)
gplot(G) # shows transitive closure graph, i.e. `a -> b -> c <- a`

# however, the edge_data is not updated this way!
@assert !in((:a, :c), keys(G.edge_data))

Possible solutions

I think the simplest thing for the short term would be to not dispatch on MetaGraph types. Obviously, would be great to have this functionality for MetaGraphs, too

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions