COIN-OR::LEMON - Graph Library

Changeset 1101:15e233f588da in lemon-main


Ignore:
Timestamp:
09/25/13 11:15:56 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
1104:a78e5b779b69, 1128:ee96cd1cad8a
Phase:
public
Message:

Fix invalid map query in NearestNeighborTsp? (#476)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/nearest_neighbor_tsp.h

    r1092 r1101  
    116116            for (IncEdgeIt e(_gr, n1); e != INVALID; ++e) {
    117117              if (!used[_gr.runningNode(e)] &&
    118                   (_cost[e] < _cost[min_edge1] || min_edge1 == INVALID)) {
     118                  (min_edge1 == INVALID || _cost[e] < _cost[min_edge1])) {
    119119                min_edge1 = e;
    120120              }
     
    125125            for (IncEdgeIt e(_gr, n2); e != INVALID; ++e) {
    126126              if (!used[_gr.runningNode(e)] &&
    127                   (_cost[e] < _cost[min_edge2] || min_edge2 == INVALID)) {
     127                  (min_edge2 == INVALID||_cost[e] < _cost[min_edge2])) {
    128128                min_edge2 = e;
    129129              }
Note: See TracChangeset for help on using the changeset viewer.