Opened 11 years ago

Closed 11 years ago

#5737 closed Bugs (fixed)

length-1 grid graph gives wrong previous vertex

Reported by: Lau Yang Hao <lauyh@…> Owned by: Andrew Sutton
Milestone: To Be Determined Component: graph
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

The previous function miscalculates the vertex index along a dimension where the grid graph's length is one. The computed vertex index is one when it should be zero. The offending code is "vertex[dimension_index] = ... length(dimension_index) - (distance % length(dimension_index))."

Attachments (1)

grid_graph_example.cpp (1.1 KB ) - added by Lau Yang Hao <lauyh@…> 11 years ago.

Download all attachments as: .zip

Change History (3)

by Lau Yang Hao <lauyh@…>, 11 years ago

Attachment: grid_graph_example.cpp added

comment:1 by Jeremiah Willcock, 11 years ago

This is a documented limitation (although the documentation on it may be incorrect). Each dimension needs to have a length of at least three (two when wrapping is enabled) for correct behavior, including in more cases than you describe such as computing outgoing edges.

comment:2 by Lau Yang Hao <lauyh@…>, 11 years ago

Resolution: fixed
Status: newclosed

Will keep that in mind. Thank you for your response!

Note: See TracTickets for help on using tickets.