AlgebraicJulia / Catlab.jl

A framework for applied category theory in the Julia language
https://www.algebraicjulia.org
MIT License
599 stars 56 forks source link

Question about abstract vs. concrete type in `enumerate_paths` #897

Closed slwu89 closed 2 months ago

slwu89 commented 3 months ago

I suspect that g::Graph in this function https://github.com/AlgebraicJulia/Catlab.jl/blob/main/src/graphs/GraphAlgorithms.jl#L122 should actually be g::HasGraph?

epatters commented 3 months ago

I agree.

slwu89 commented 2 months ago

@epatters I also noticed in https://github.com/AlgebraicJulia/Catlab.jl/blob/main/src/graphs/GraphSearching.jl that we have dfs_tree(g::AbstractGraph, s::Integer; dir=:out) but bfs_tree(g::ACSet, s::Integer; dir = :out). I assume that most of the graph algorithms take g::ACSet because outneighbors and inneighbors are also defined for wiring diagrams which aren't in the same inheritance hierarchy as the graph types. Is that right? And also, it seems that, following that logic, the type for dfs_tree should be ACSet.