Opened 11 years ago

Closed 11 years ago

#5779 closed Bugs (invalid)

Bug in Boost BGL graph traversal

Reported by: public@… Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.42.0 Severity: Showstopper
Keywords: Cc:

Description

Using listS as the representation for both vertices and edges, BGL's depth_first_search sometimes calls back_edge() on visitors even if there are no cycles in the graph.

Code example: http://static.ali01.com/bgl.cc

The above program should not print "back edge", but does.

Attachments (1)

bgl.cc (1.7 KB ) - added by public@… 11 years ago.
code example of bug

Download all attachments as: .zip

Change History (2)

by public@…, 11 years ago

Attachment: bgl.cc added

code example of bug

comment:1 by Jeremiah Willcock, 11 years ago

Resolution: invalid
Status: newclosed

You are not initializing the vertex_index property of your graph. Try adding some code such as:

graph_traits<Graph>::vertices_size_type i = 0;
BGL_FORALL_VERTICES(v, graph, Graph) put(vertex_index, g, v, i++);

before your call to depth_first_search (filling in the types for your code, and #includeing <boost/graph/iteration_macros.hpp>).

Note: See TracTickets for help on using tickets.