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

Commit

Permalink
Fix call to and missing requirement declaration on vertex_index
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Sep 13, 2014
1 parent 3231261 commit 471932c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function to_dot{G<:AbstractGraph}(graph::G, stream::IO)
has_edge_attrs = method_exists(attributes, (edge_type(graph), G))

write(stream, "$(graph_type_string(graph)) graphname {\n")
if implements_edge_list(graph)
if implements_edge_list(graph) && implements_vertex_map(graph)
for edge in edges(graph)
write(stream,"$(vertex_index(source(edge), graph)) $(edge_op(graph)) $(vertex_index(target(edge), graph))\n")
end
Expand All @@ -42,7 +42,7 @@ function to_dot{G<:AbstractGraph}(graph::G, stream::IO)
else # implements_adjacency_list
for n in out_neighbors(vertex, graph)
if is_directed(graph) || vertex_index(n, graph) > vertex_index(vertex, graph)
write(stream,"$(vertex_index(vertex, graph)) $(edge_op(graph)) $(vertex_index(n))\n")
write(stream,"$(vertex_index(vertex, graph)) $(edge_op(graph)) $(vertex_index(n,graph))\n")
end
end
end
Expand Down

0 comments on commit 471932c

Please sign in to comment.