From 9c95545a548471aca956116d2fceda3bb5987fef Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 12 Feb 2024 15:26:26 -0500 Subject: [PATCH] Extend union to multiple named graphs --- src/abstractnamedgraph.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/abstractnamedgraph.jl b/src/abstractnamedgraph.jl index 319fbda..8a02734 100644 --- a/src/abstractnamedgraph.jl +++ b/src/abstractnamedgraph.jl @@ -381,6 +381,15 @@ function union(graph1::AbstractNamedGraph, graph2::AbstractNamedGraph) return union_graph end +function union( + graph1::AbstractNamedGraph, + graph2::AbstractNamedGraph, + graph3::AbstractNamedGraph, + graph_rest::AbstractNamedGraph..., +) + return union(union(graph1, graph2), graph3, graph_rest...) +end + function rem_vertex!(graph::AbstractNamedGraph, vertex) if vertex ∉ vertices(graph) return false