Fix ambiguity in edge weights by using minimal weight

This commit is contained in:
Michael Krasnyk
2016-07-05 20:29:04 +02:00
parent b00b15ab98
commit e17b306265
2 changed files with 18 additions and 1 deletions
+2
View File
@@ -453,11 +453,13 @@ void ExtractionContainers::PrepareEdges(lua_State *segment_state)
all_edges_list[i].result.weight < min_forward_weight)
{
min_forward_idx = i;
min_forward_weight = all_edges_list[i].result.weight;
}
if (all_edges_list[i].result.backward &&
all_edges_list[i].result.weight < min_backward_weight)
{
min_backward_idx = i;
min_backward_weight = all_edges_list[i].result.weight;
}
// this also increments the outer loop counter!