Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lars Göttgens <lars.goettgens@rwth-aachen.de>
  • Loading branch information
antonydellavecchia and lgoettgens authored Oct 31, 2024
1 parent 4968376 commit 4ef8766
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/oscar_references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,7 @@ @InProceedings{Kal02
shortseries = {Adv. Stud. Pure Math.},
shortpublisher= {Math. Soc. Japan},
location = {Tokyo},
dor = {10.2969/aspm/03310121}
doi = {10.2969/aspm/03310121}
}

@Article{Kem02,
Expand Down
4 changes: 1 addition & 3 deletions src/Combinatorics/Graphs/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1172,9 +1172,7 @@ end
function graph_from_edges(::Type{T},
edges::Vector{Edge},
n_vertices::Int=-1) where {T <: Union{Directed, Undirected}}
isempty(edges) && return Graph{T}(n_vertices)

n_needed = maximum(reduce(append!,[[src(e),dst(e)] for e in edges];))
n_needed = maximum(reduce(append!,[[src(e),dst(e)] for e in edges];); init=0)
@req (n_vertices >= n_needed || n_vertices < 0) "n_vertices must be at least the maximum vertex in the edges"

g = Graph{T}(max(n_needed, n_vertices))
Expand Down

0 comments on commit 4ef8766

Please sign in to comment.