@@ -2,7 +2,11 @@ using Dictionaries: Dictionaries, Indices, isinsertable, set!
22using Graphs: edges, edgetype, has_edge, has_vertex, rem_edge!, rem_vertex!, vertices
33using NamedGraphs: NamedGraphs, Vertices, similar_graph, subgraph_edges, to_graph_index
44
5- abstract type AbstractVertexOrEdgeDataGraph{T, V} <: AbstractDataGraph{V, T, T} end
5+ abstract type AbstractVertexDataGraph{T, V} <: AbstractDataGraph{V, T, Nothing} end
6+ abstract type AbstractEdgeDataGraph{T, V} <: AbstractDataGraph{V, Nothing, T} end
7+
8+ const AbstractVertexOrEdgeDataGraph{T, V} =
9+ Union{AbstractVertexDataGraph{T, V}, AbstractEdgeDataGraph{T, V}}
610
711Graphs. edgetype (graph:: AbstractVertexOrEdgeDataGraph ) = edgetype (typeof (graph))
812
6973
7074# ================================== vertex data graph =================================== #
7175
72- abstract type AbstractVertexDataGraph{T, V} <: AbstractVertexOrEdgeDataGraph{T, V} end
73-
7476Base. keytype (:: Type{<:AbstractVertexDataGraph{T, V}} ) where {T, V} = V
7577
7678is_edge_assigned (:: AbstractVertexDataGraph , _edge) = false
167169
168170# =================================== edge data graph ==================================== #
169171
170- abstract type AbstractEdgeDataGraph{T, V} <: AbstractVertexOrEdgeDataGraph{T, V} end
171-
172172Base. keytype (:: Type{<:AbstractEdgeDataGraph{T, V}} ) where {T, V} = NamedEdge{V}
173173
174174is_vertex_assigned (:: AbstractEdgeDataGraph , _vertex) = false
0 commit comments