Skip to content

Commit 5d0866b

Browse files
GiggleLiuRoger-luo
andauthored
switch LightGraphs to Graphs (#11)
* switch LightGraphs to Graphs * bump version * change ci to latest stable version * Update Project.toml Co-authored-by: Rogerluo <[email protected]>
1 parent 8d1c075 commit 5d0866b

13 files changed

+28
-28
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
version:
13-
- '1.5'
13+
- '1'
1414
- 'nightly'
1515
os:
1616
- ubuntu-latest

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name = "Multigraphs"
22
uuid = "7ebac608-6c66-46e6-9856-b5f43e107bac"
33
authors = ["Chen Zhao"]
4-
version = "0.2.2"
4+
version = "0.3.0"
55

66
[deps]
7-
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
7+
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
88
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
99
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1010

1111
[compat]
12-
LightGraphs = "1"
12+
Graphs = "1.4"
1313
julia = "1.2"
1414

1515
[extras]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![CI](https://github.com/QuantumBFS/Multigraphs.jl/workflows/CI/badge.svg)](https://github.com/QuantumBFS/Multigraphs.jl/actions)
44
[![Codecov](https://codecov.io/gh/QuantumBFS/Multigraphs.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/QuantumBFS/Multigraphs.jl)
55

6-
Multigraphs extension for `LightGraphs.jl`.
6+
Multigraphs extension for `Graphs.jl`.
77

88
## Installation
99

@@ -25,7 +25,7 @@ pkg> add Multigraphs
2525
## Examples
2626

2727
```julia
28-
using LightGraphs, Multigraphs
28+
using Graphs, Multigraphs
2929

3030
# create a undirected multigraph with 3 vertices and 0 multiple edges
3131
# use DiMultigraph for directed multigraphs
@@ -53,7 +53,7 @@ julia> mes = [me for me in edges(mg)]
5353
Multiple edge 1 => 2 with multiplicity 2
5454
Multiple edge 2 => 3 with multiplicity 1
5555

56-
# here e is a LightGraphs.SimpleEdge
56+
# here e is a Graphs.SimpleEdge
5757
julia> for e in mes[1]
5858
println(e)
5959
end

src/Multigraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Multigraphs
33
4-
An multigraph extension for `LightGraphs`.
4+
An multigraph extension for `Graphs`.
55
"""
66
module Multigraphs
77

src/abstract_multigraph.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using LightGraphs
1+
using Graphs
22
using SparseArrays
33

44
import Base: show, eltype, copy
5-
import LightGraphs: nv, has_edge, has_vertex, add_edge!, rem_edge!, rem_vertex!,
5+
import Graphs: nv, has_edge, has_vertex, add_edge!, rem_edge!, rem_vertex!,
66
rem_vertices!, add_vertex!, add_vertices!, outneighbors, inneighbors, vertices, edges,
77
adjacency_matrix, src, dst, nv, edgetype
88

@@ -57,7 +57,7 @@ is not less than `mul`.
5757
5858
## Examples
5959
```julia
60-
julia> using LightGraphs, Multigraphs
60+
julia> using Graphs, Multigraphs
6161
6262
julia> mg = Multigraph(3);
6363
@@ -82,7 +82,7 @@ Return `true` multiple edge was added successfully, otherwise return `false`.
8282
8383
## Examples
8484
```julia
85-
julia> using LightGraphs, Multigraphs
85+
julia> using Graphs, Multigraphs
8686
8787
julia> mg = Multigraph(3);
8888
@@ -109,7 +109,7 @@ a multiple edge.
109109
110110
## Examples
111111
```julia
112-
julia> using LightGraphs, Multigraphs
112+
julia> using Graphs, Multigraphs
113113
114114
julia> mg = Multigraph(3);
115115
@@ -139,7 +139,7 @@ Return a `MultipleEdgeIter` for `mg`.
139139
## Examples
140140
```jltestdoc
141141
julia>
142-
julia> using LightGraphs, Multigraphs
142+
julia> using Graphs, Multigraphs
143143
144144
julia> mg = Multigraph(path_graph(4));
145145

src/di_multigraph_adjlist.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using LightGraphs, SparseArrays, LinearAlgebra
1+
using Graphs, SparseArrays, LinearAlgebra
22

33
import Base: copy
4-
import LightGraphs: nv, has_edge, add_edge!, rem_edge!, rem_vertex!,
4+
import Graphs: nv, has_edge, add_edge!, rem_edge!, rem_vertex!,
55
rem_vertices!, add_vertex!, add_vertices!, outneighbors, inneighbors, neighbors,
66
vertices, adjacency_matrix, ne, is_directed, degree, indegree, outdegree, edges,
77
has_vertex, all_neighbors
@@ -53,7 +53,7 @@ function DiMultigraph(n::T) where {T<:Integer}
5353
end
5454
return DiMultigraph(adjlist)
5555
end
56-
DiMultigraph(g::SimpleDiGraph{T}) where {T<:Integer} = DiMultigraph(Dict(zip(T(1):nv(g), LightGraphs.SimpleGraphs.fadj(g))))
56+
DiMultigraph(g::SimpleDiGraph{T}) where {T<:Integer} = DiMultigraph(Dict(zip(T(1):nv(g), Graphs.SimpleGraphs.fadj(g))))
5757

5858
copy(mg::DiMultigraph{T}) where {T} = DiMultigraph{T}(deepcopy(mg.adjlist), mg._idmax)
5959

src/multigraph_adjlist.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using LightGraphs, SparseArrays, LinearAlgebra
1+
using Graphs, SparseArrays, LinearAlgebra
22

33
import Base: copy
4-
import LightGraphs: nv, has_edge, add_edge!, rem_edge!, rem_vertex!,
4+
import Graphs: nv, has_edge, add_edge!, rem_edge!, rem_vertex!,
55
rem_vertices!, add_vertex!, add_vertices!, outneighbors, inneighbors, neighbors,
66
vertices, adjacency_matrix, ne, is_directed, degree, indegree, outdegree, edges,
77
has_vertex, all_neighbors
@@ -56,7 +56,7 @@ function Multigraph(n::T) where {T<:Integer}
5656
end
5757
return Multigraph(adjlist)
5858
end
59-
Multigraph(g::SimpleGraph{T}) where {T<:Integer} = Multigraph(Dict(zip(T(1):nv(g), LightGraphs.SimpleGraphs.fadj(g))))
59+
Multigraph(g::SimpleGraph{T}) where {T<:Integer} = Multigraph(Dict(zip(T(1):nv(g), Graphs.SimpleGraphs.fadj(g))))
6060

6161
copy(mg::Multigraph{T}) where {T} = Multigraph{T}(deepcopy(mg.adjlist), mg._idmax)
6262

src/multiple_edge.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Base: eltype, Pair, Tuple, show, ==, iterate, length
2-
import LightGraphs: AbstractEdge, SimpleEdge, src, dst, reverse
2+
import Graphs: AbstractEdge, SimpleEdge, src, dst, reverse
33

44
export AbstractMultipleEdge, MultipleEdge, mul
55

@@ -17,7 +17,7 @@ A struct representing multiple edges.
1717
1818
## Examples
1919
```jltestdoc
20-
julia> using LightGraphs, Multigraphs
20+
julia> using Graphs, Multigraphs
2121
2222
julia> me = MultipleEdge(1, 2, 3)
2323
Multiple edge 1 => 2 with multiplicity 3
@@ -67,7 +67,7 @@ Return the multiplicity of the multiple edge `e`.
6767
6868
## Examples
6969
```jltestdoc
70-
julia> using LightGraphs, Multigraphs
70+
julia> using Graphs, Multigraphs
7171
7272
julia> me = MultipleEdge(1, 2, 3)
7373
Multiple edge 1 => 2 with multiplicity 3

src/multiple_edge_iter.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using LightGraphs
1+
using Graphs
22

33
import Base: eltype, iterate, length
44

test/di_multigraph_adjlist.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Multigraphs, LightGraphs, SparseArrays
1+
using Multigraphs, Graphs, SparseArrays
22
using Test
33
try
44
m2 = spzeros(Int, 2, 3)

0 commit comments

Comments
 (0)