Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
make Dict default vertexcolormap
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloLucibello committed Apr 12, 2016
1 parent d55b136 commit 7d5e2d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/traversals/bfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function traverse_graph!(
alg::BreadthFirst,
source,
visitor::SimpleGraphVisitor;
vertexcolormap = zeros(Int, nv(graph)),
vertexcolormap = Dict{Int, Int}(),
edgecolormap = DummyEdgeMap(),
queue = Vector{Int}())

Expand Down Expand Up @@ -224,7 +224,7 @@ BipartiteVisitor(n::Int) = BipartiteVisitor(zeros(UInt8,n), true)

function examine_neighbor!(visitor::BipartiteVisitor, u::Int, v::Int, vcolor::Int, ecolor::Int)
if vcolor == 0
visitor.bipartitemap[v] = (visitor.bipartitemap[u] == 1)? 2:1
visitor.bipartitemap[v] = (visitor.bipartitemap[u] == 1) ? 2 : 1
else
if visitor.bipartitemap[v] == visitor.bipartitemap[u]
visitor.is_bipartite = false
Expand Down
2 changes: 1 addition & 1 deletion src/traversals/dfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function traverse_graph!(
alg::DepthFirst,
s::Int,
visitor::SimpleGraphVisitor;
vertexcolormap = zeros(Int, nv(graph)),
vertexcolormap = Dict{Int, Int}(),
edgecolormap = DummyEdgeMap())

vertexcolormap[s] = 1
Expand Down

0 comments on commit 7d5e2d9

Please sign in to comment.