COIN-OR::LEMON - Graph Library

Changeset 438:81d40f1c850c in lemon-main


Ignore:
Timestamp:
12/21/08 20:45:25 (16 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Children:
439:1229dc2f1d36, 475:8b56605db6a8
Phase:
public
Message:

Bug fix in heap unionfind (ticket #197)

The previous bugfix set the minimum value in internal nodes
wrongly. It corrects the problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/unionfind.h

    r436 r438  
    11781178            if (nodes[nodes[jd].next].size < cmax) {
    11791179              pushLeft(nodes[jd].next, nodes[jd].left);
    1180               if (nodes[jd].item == nodes[pd].item) {
     1180              if (less(jd, nodes[jd].next) ||
     1181                  nodes[jd].item == nodes[pd].item) {
    11811182                nodes[nodes[jd].next].prio = nodes[jd].prio;
    11821183                nodes[nodes[jd].next].item = nodes[jd].item;
     
    12211222            if (nodes[nodes[jd].prev].size < cmax) {
    12221223              pushRight(nodes[jd].prev, nodes[jd].right);
    1223               if (nodes[jd].item == nodes[pd].item) {
     1224              if (less(jd, nodes[jd].prev) ||
     1225                  nodes[jd].item == nodes[pd].item) {
    12241226                nodes[nodes[jd].prev].prio = nodes[jd].prio;
    12251227                nodes[nodes[jd].prev].item = nodes[jd].item;
     
    12531255      return comp(nodes[id].prio, nodes[jd].prio);
    12541256    }
    1255 
    1256     bool equal(int id, int jd) const {
    1257       return !less(id, jd) && !less(jd, id);
    1258     }
    1259 
    12601257
    12611258  public:
Note: See TracChangeset for help on using the changeset viewer.