src/main/java/de/dfki/lt/loot/jada/FibonacciHeapBase.java
public void decreaseKey(HeapNode<Data> node) {
    if (node.degree < 0)
      throw new IllegalArgumentException(
          "Trying to call decreaseKey with a removed heap node");
    // Check if the new key violates the heap invariant:
    HeapNode<Data> parent = node.parent;
    if (parent == null) { // root node - just make sure the minimum is correct
      if (_comparator.compare(node.data, rootWithMinKey.data) < 0)
        rootWithMinKey = node;
      return; // heap invariant not violated - nothing more to do
    } else if (_comparator.compare(parent.data, node.data) <= 0) {
      return; // heap invariant not violated - nothing more to do
    }

    for(;;) {
      parent.removeChild(node);
      insertNode(node);
      if (debugDecreaseKey) {
        System.out.println("  removed " + node + " as child of " + parent);
        System.out.println("  roots after remove: " + rootWithMinKey.printAll());
      }

      if (parent.parent == null) {
        // parent is a root - nothing more to do
        break;
      } else if (!parent.mark) {
        // parent is not a root and is not marked - just mark it
        parent.mark = true;
        break;
      } else {
        node = parent;
        parent = parent.parent;
      }
    }
  }
/** Signal that the value of data has been decreased
   *  The new key must be strictly smaller than the old one, otherwise, an
   *  IllegalArgumentException will be thrown.
   */
Signal that the value of data has been decreased
The new key must be strictly smaller than the old one, otherwise, an
IllegalArgumentException will be thrown.
Signal that the value of data has been decreased The new key must be strictly smaller than the old one otherwise an IllegalArgumentException will be thrown .
public void decreaseKey(HeapNode<Data> node) {
    if (node.degree < 0)
      throw new IllegalArgumentException(
          "Trying to call decreaseKey with a removed heap node");
    HeapNode<Data> parent = node.parent;
    if (parent == null) { 
      if (_comparator.compare(node.data, rootWithMinKey.data) < 0)
        rootWithMinKey = node;
      return; 
    } else if (_comparator.compare(parent.data, node.data) <= 0) {
      return; 
    }
    for(;;) {
      parent.removeChild(node);
      insertNode(node);
      if (debugDecreaseKey) {
        System.out.println("  removed " + node + " as child of " + parent);
        System.out.println("  roots after remove: " + rootWithMinKey.printAll());
      }
      if (parent.parent == null) {
        break;
      } else if (!parent.mark) {
        parent.mark = true;
        break;
      } else {
        node = parent;
        parent = parent.parent;
      }
    }
  }
public void decreaseKey ( HeapNode < Data > node ) { if ( node . degree < 0 ) throw new IllegalArgumentException ( "Trying to call decreaseKey with a removed heap node" ) ; HeapNode < Data > parent = node . parent ; if ( parent == null ) { if ( _comparator . compare ( node . data , rootWithMinKey . data ) < 0 ) rootWithMinKey = node ; return ; } else if ( _comparator . compare ( parent . data , node . data ) <= 0 ) { return ; } for ( ; ; ) { parent . removeChild ( node ) ; insertNode ( node ) ; if ( debugDecreaseKey ) { System . out . println ( "  removed " + node + " as child of " + parent ) ; System . out . println ( "  roots after remove: " + rootWithMinKey . printAll ( ) ) ; } if ( parent . parent == null ) { break ; } else if ( ! parent . mark ) { parent . mark = true ; break ; } else { node = parent ; parent = parent . parent ; } } }
Signal that the value of data has been decreased
  The new key must be strictly smaller than the old one, otherwise, an
  IllegalArgumentException will be thrown.
Signal that the value of data has been decreased The new key must be strictly smaller than the old one otherwise an IllegalArgumentException will be thrown .
// Check if the new key violates the heap invariant: // root node - just make sure the minimum is correct // heap invariant not violated - nothing more to do // heap invariant not violated - nothing more to do // parent is a root - nothing more to do // parent is not a root and is not marked - just mark it