Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added iterators for dfs and bfs #163

Merged
merged 40 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d5922fc
added iterators for dfs and bfs
kylebeggs Aug 16, 2022
fa40087
fixed exisintg identifier issue
kylebeggs Aug 17, 2022
1d513a5
added iterators for dfs and bfs
kylebeggs Aug 16, 2022
a279eca
fixed exisintg identifier issue
kylebeggs Aug 17, 2022
d6b120c
add abstract iterator state and fix first iter arg
kylebeggs Aug 22, 2022
9e941c8
iterator refactor
kylebeggs Sep 19, 2022
0ff24ef
created iterators src folder, added kruskal
kylebeggs Sep 20, 2022
1f59073
created iterators src folder, added kruskal
kylebeggs Mar 15, 2023
3a5794a
Merge branch 'JuliaGraphs:master' into master
kylebeggs Jul 8, 2023
1bcc1c1
multi source version for bfs and dfs
Tortar Jan 29, 2024
9bfafbe
fix
Tortar Jan 29, 2024
48a2512
Merge branch 'master' into master
Tortar Jan 29, 2024
72c6840
remove kruskal
Tortar Jan 29, 2024
dd63b60
Update Graphs.jl
Tortar Jan 29, 2024
c6fdf27
remove kruskal from pages
Tortar Jan 29, 2024
27aa945
format
Tortar Jan 29, 2024
b5df963
format 2
Tortar Jan 29, 2024
c14111f
format branch
Tortar Jan 29, 2024
790572e
improve perf of bfs
Tortar Jan 29, 2024
4f6bd50
optimize bfs
Tortar Jan 29, 2024
8f4223f
use copy of source nodes
Tortar Jan 29, 2024
a56ced8
Update bfs.jl
Tortar Jan 29, 2024
19a4aa6
improve dfs
Tortar Jan 29, 2024
e52f03a
Update bfs.jl
Tortar Jan 29, 2024
a96d943
use size unknown
Tortar Mar 2, 2024
f5f60cc
Update bfs.jl
Tortar Mar 2, 2024
09f1edd
Merge branch 'JuliaGraphs:master' into master
Tortar Mar 2, 2024
80c1d0f
Clean up
gdalle Mar 5, 2024
a48b4c0
Fix typo
gdalle Mar 5, 2024
971c790
Fix tests and length
gdalle Mar 5, 2024
af494f6
Remove ref
gdalle Mar 5, 2024
74c003b
Fix eltype
gdalle Mar 5, 2024
22df731
Merge branch 'JuliaGraphs:master' into master
Tortar Apr 28, 2024
9022e24
address review comments
Tortar Apr 28, 2024
c89176e
some more comments
Tortar Apr 28, 2024
9fd1a3a
Update bfs.jl
Tortar Apr 28, 2024
a3b7a9e
Update bfs.jl
Tortar Apr 28, 2024
a26a165
Update dfs.jl
Tortar Apr 28, 2024
de59874
formatting
Tortar Apr 28, 2024
10e7c6e
Apply suggestions from code review
gdalle May 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove ref
  • Loading branch information
gdalle committed Mar 5, 2024
commit af494f62cfb8d6fb8109dd84164fbe952ecddb2c
2 changes: 1 addition & 1 deletion src/iterators/bfs.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
BFSIterator

`BFSIterator` is a subtype of [`VertexIterator`](@ref) to iterate through graph vertices using a breadth-first search. A source node(s) is optionally supplied as an `Int` or an array-like type that can be indexed if supplying multiple sources. If no source is provided, it defaults to the first vertex.
`BFSIterator` is used to iterate through graph vertices using a breadth-first search. A source node(s) is optionally supplied as an `Int` or an array-like type that can be indexed if supplying multiple sources. If no source is provided, it defaults to the first vertex.

# Examples
```julia-repl
Expand Down Expand Up @@ -36,10 +36,10 @@
n_visited::Int
end

BFSIterator(g::AbstractGraph) = BFSIterator(g, first(vertices(g)))

Check warning on line 39 in src/iterators/bfs.jl

View check run for this annotation

Codecov / codecov/patch

src/iterators/bfs.jl#L39

Added line #L39 was not covered by tests

Base.IteratorSize(::Type{BFSIterator}) = Base.SizeUnknown()
Base.eltype(::Type{BFSIterator}) = eltype(t.graph)

Check warning on line 42 in src/iterators/bfs.jl

View check run for this annotation

Codecov / codecov/patch

src/iterators/bfs.jl#L41-L42

Added lines #L41 - L42 were not covered by tests

"""
Base.iterate(t::BFSIterator)
Expand Down
2 changes: 1 addition & 1 deletion src/iterators/dfs.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
DFSIterator

`DFSIterator` is a subtype of [`VertexIterator`](@ref) to iterate through graph vertices using a depth-first search. A source node(s) is optionally supplied as an `Int` or an array-like type that can be indexed if supplying multiple sources. If no source is provided, it defaults to the first vertex.
`DFSIterator` is used to iterate through graph vertices using a depth-first search. A source node(s) is optionally supplied as an `Int` or an array-like type that can be indexed if supplying multiple sources. If no source is provided, it defaults to the first vertex.

# Examples
```julia-repl
Expand Down Expand Up @@ -34,10 +34,10 @@
queue::Vector{Int}
gdalle marked this conversation as resolved.
Show resolved Hide resolved
end

DFSIterator(g::AbstractGraph) = DFSIterator(g, first(vertices(g)))

Check warning on line 37 in src/iterators/dfs.jl

View check run for this annotation

Codecov / codecov/patch

src/iterators/dfs.jl#L37

Added line #L37 was not covered by tests

Base.IteratorSize(::Type{DFSIterator}) = Base.SizeUnknown()
Base.eltype(::Type{DFSIterator}) = eltype(t.graph)

Check warning on line 40 in src/iterators/dfs.jl

View check run for this annotation

Codecov / codecov/patch

src/iterators/dfs.jl#L39-L40

Added lines #L39 - L40 were not covered by tests

"""
Base.iterate(t::DFSIterator)
Expand Down
Loading