diff --git a/src/LightGraphs.jl b/src/LightGraphs.jl index 3cb61e224..c6bd9f981 100644 --- a/src/LightGraphs.jl +++ b/src/LightGraphs.jl @@ -28,7 +28,7 @@ export # Interface AbstractGraph, AbstractEdge, AbstractEdgeIter, Edge, Graph, SimpleGraph, DiGraph, SimpleDiGraph, vertices, edges, edgetype, nv, ne, src, dst, -is_directed, add_vertex!, add_edge!, rem_vertex!, rem_edge!, +is_directed, has_vertex, has_edge, inneighbors, outneighbors, # core @@ -37,6 +37,9 @@ is_ordered, add_vertices!, indegree, outdegree, degree, neighbors, all_neighbors, common_neighbors, has_self_loops, num_self_loops, density, squash, weights, +# simplegraphs +add_edge!, add_vertex!, add_vertices!, rem_edge!, rem_vertex!, + # decomposition core_number, k_core, k_shell, k_crust, k_corona, diff --git a/src/SimpleGraphs/SimpleGraphs.jl b/src/SimpleGraphs/SimpleGraphs.jl index 533e9b2f2..437faeedd 100644 --- a/src/SimpleGraphs/SimpleGraphs.jl +++ b/src/SimpleGraphs/SimpleGraphs.jl @@ -9,14 +9,14 @@ import Base: import LightGraphs: _NI, _insert_and_dedup!, AbstractGraph, AbstractEdge, AbstractEdgeIter, src, dst, edgetype, nv, ne, vertices, edges, is_directed, - add_vertex!, add_edge!, rem_vertex!, rem_edge!, has_vertex, has_edge, inneighbors, outneighbors, indegree, outdegree, degree, has_self_loops, num_self_loops, insorted -export AbstractSimpleGraph, AbstractSimpleDiGraph, AbstractSimpleEdge, +export AbstractSimpleGraph, AbstractSimpleEdge, SimpleEdge, SimpleGraph, SimpleGraphEdge, - SimpleDiGraph, SimpleDiGraphEdge + SimpleDiGraph, SimpleDiGraphEdge, + add_vertex!, add_edge!, rem_vertex!, rem_edge! """ diff --git a/src/interface.jl b/src/interface.jl index b57901822..359477996 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -124,37 +124,6 @@ Return true if the graph is a directed graph; false otherwise. """ is_directed(g) = _NI("is_directed") is_directed(::Type{T}) where T = _NI("is_directed") -""" - add_vertex!(g) - -Add a new vertex to the graph `g`. -Return true if the vertex was added successfully, false otherwise. -""" -add_vertex!(x) = _NI("add_vertex!") - -""" - add_edge!(g, e) - -Add a new edge `e` to `g`. Return false if add fails -(e.g., if vertices are not in the graph, or edge already exists), true otherwise. -""" -add_edge!(x, e) = _NI("add_edge!") - -""" - rem_vertex!(g, v) - -Remove the vertex `v` from graph `g`. Return false if removal fails -(e.g., if vertex is not in the graph), true otherwise. -""" -rem_vertex!(x, v) = _NI("rem_vertex!") - -""" - rem_edge!(g, e) - -Remove the edge `e` from `g`. Return false if edge removal fails -(e.g., if edge does not exist), true otherwise. -""" -rem_edge!(x, e) = _NI("rem_edge!") """ has_vertex(g, v) diff --git a/test/interface.jl b/test/interface.jl index 5509f6433..30a777cc3 100644 --- a/test/interface.jl +++ b/test/interface.jl @@ -19,18 +19,18 @@ mutable struct DummyEdge <: AbstractEdge{Int} end for graphfunbasic in [ nv, ne, vertices, edges, is_directed, - add_vertex!, edgetype, eltype, zero + edgetype, eltype, zero ] @test_throws ErrorException graphfunbasic(dummygraph) end for graphfun1int in [ - rem_vertex!, has_vertex, inneighbors, outneighbors + has_vertex, inneighbors, outneighbors ] @test_throws ErrorException graphfun1int(dummygraph, 1) end for graphfunedge in [ - has_edge, add_edge!, rem_edge! + has_edge, ] @test_throws ErrorException graphfunedge(dummygraph, dummyedge) end