diff --git a/Project.toml b/Project.toml index d926dbb..015a81b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NamedGraphs" uuid = "678767b0-92e7-4007-89e4-4527a8725b19" authors = ["Matthew Fishman and contributors"] -version = "0.4.1" +version = "0.4.2" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" diff --git a/src/abstractnamedgraph.jl b/src/abstractnamedgraph.jl index 581f6f3..822f169 100644 --- a/src/abstractnamedgraph.jl +++ b/src/abstractnamedgraph.jl @@ -35,7 +35,7 @@ using .GraphsExtensions: partitioned_vertices, rename_vertices, subgraph -using SimpleTraits: SimpleTraits, @traitfn +using SimpleTraits: SimpleTraits, Not, @traitfn abstract type AbstractNamedGraph{V} <: AbstractGraph{V} end diff --git a/src/dfs.jl b/src/dfs.jl index 268c629..dedd093 100644 --- a/src/dfs.jl +++ b/src/dfs.jl @@ -1,5 +1,5 @@ using Graphs: Graphs, dfs_parents, dfs_tree, topological_sort_by_dfs -using SimpleTraits: SimpleTraits, @traitfn +using SimpleTraits: SimpleTraits, Not, @traitfn @traitfn function Graphs.topological_sort_by_dfs(g::AbstractNamedGraph::IsDirected) return parent_vertices_to_vertices(g, topological_sort_by_dfs(parent_graph(g))) diff --git a/src/distances_and_capacities.jl b/src/distances_and_capacities.jl index e384123..a101f7d 100644 --- a/src/distances_and_capacities.jl +++ b/src/distances_and_capacities.jl @@ -2,7 +2,7 @@ using Dictionaries: AbstractDictionary using Graphs: Graphs, IsDirected, dst, edges, nv, src using .GraphsExtensions: directed_graph using LinearAlgebra: Symmetric -using SimpleTraits: SimpleTraits, @traitfn +using SimpleTraits: SimpleTraits, Not, @traitfn using SparseArrays: sparse, spzeros # TODO: Move to `GraphsExtensions`. diff --git a/src/lib/GraphsExtensions/src/abstractgraph.jl b/src/lib/GraphsExtensions/src/abstractgraph.jl index 18c1b75..7c0a132 100644 --- a/src/lib/GraphsExtensions/src/abstractgraph.jl +++ b/src/lib/GraphsExtensions/src/abstractgraph.jl @@ -24,7 +24,7 @@ using Graphs: rem_vertex!, weights using Graphs.SimpleGraphs: AbstractSimpleGraph -using SimpleTraits: SimpleTraits, @traitfn +using SimpleTraits: SimpleTraits, Not, @traitfn using SplitApplyCombine: groupfind not_implemented() = error("Not implemented") @@ -131,12 +131,12 @@ end end # Alternative syntax to `getindex` for getting a subgraph -function subgraph(graph::AbstractGraph, subvertices::Vector) - return induced_subgraph(graph, subvertices)[1] +function subgraph(graph::AbstractGraph, vertices) + return induced_subgraph(graph, vertices)[1] end function subgraph(f::Function, graph::AbstractGraph) - return induced_subgraph(graph, filter(f, vertices(graph)))[1] + return subgraph(graph, filter(f, vertices(graph))) end function degrees(graph::AbstractGraph, vertices=vertices(graph)) diff --git a/src/lib/GraphsExtensions/src/trees_and_forests.jl b/src/lib/GraphsExtensions/src/trees_and_forests.jl index 9167677..505d638 100644 --- a/src/lib/GraphsExtensions/src/trees_and_forests.jl +++ b/src/lib/GraphsExtensions/src/trees_and_forests.jl @@ -1,6 +1,6 @@ using Graphs: IsDirected, bfs_tree, connected_components, edges, edgetype using .GraphsExtensions: random_bfs_tree, rem_edges, undirected_graph -using SimpleTraits: SimpleTraits, @traitfn +using SimpleTraits: SimpleTraits, Not, @traitfn abstract type SpanningTreeAlgorithm end diff --git a/src/lib/NamedGraphGenerators/src/NamedGraphGenerators.jl b/src/lib/NamedGraphGenerators/src/NamedGraphGenerators.jl index a15f739..ab289ee 100644 --- a/src/lib/NamedGraphGenerators/src/NamedGraphGenerators.jl +++ b/src/lib/NamedGraphGenerators/src/NamedGraphGenerators.jl @@ -14,7 +14,7 @@ using Graphs.SimpleGraphs: AbstractSimpleGraph using ..GraphGenerators: comb_tree using ..GraphsExtensions: add_edges!, rem_vertices! using ..NamedGraphs: NamedGraph -using SimpleTraits: SimpleTraits, @traitfn +using SimpleTraits: SimpleTraits, Not, @traitfn ## TODO: Bring this back in some form? ## TODO: Move to `GraphsExtensions`? diff --git a/src/steiner_tree.jl b/src/steiner_tree.jl index e889ce8..bd730ca 100644 --- a/src/steiner_tree.jl +++ b/src/steiner_tree.jl @@ -1,5 +1,5 @@ using Graphs: Graphs, IsDirected, nv, steiner_tree -using SimpleTraits: SimpleTraits, @traitfn +using SimpleTraits: SimpleTraits, Not, @traitfn @traitfn function Graphs.steiner_tree( g::AbstractNamedGraph::(!IsDirected), term_vert, distmx=weights(g)