CPP Version of KShortest Path. File: QYShortestPath.cpp Line 151
During my experiments: On a certain graph (Road Network Luxemburg) with
certain s-t-Relations, the KShortest Path seqfaults at line 154 cause index
out of range of vector m_vEdges.
I think thix fixes it:
Replace
for (std::size_t j = 0; j < edges_count; ++j)
with
for (std::size_t j = 0; j < m_vEdges.size(); ++j)
m_vEdges.size() can be different from edges_count since some edges may
become disconnected and hence not added to m_vEdges.
This bug is usually not discovered since m_vEdges and edges_count mostly
vary only little and a vector often reserve more space than needed so
exceeding the vector boundaries is not discoverd (and may add some random
stuff to the new graph).
Original issue reported on code.google.com by Jonathan...@googlemail.com on 23 Feb 2010 at 2:40
Original issue reported on code.google.com by
Jonathan...@googlemail.com
on 23 Feb 2010 at 2:40Attachments: